[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v0 18/42] drivers/xen: Check notifier registration return value
From: Borislav Petkov <bp@xxxxxxx> Avoid homegrown notifier registration checks. No functional changes. Signed-off-by: Borislav Petkov <bp@xxxxxxx> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx --- drivers/xen/manage.c | 3 ++- drivers/xen/xenbus/xenbus_probe.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 374d36de7f5a..f3c5cef0995f 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -48,7 +48,8 @@ static RAW_NOTIFIER_HEAD(xen_resume_notifier); void xen_resume_notifier_register(struct notifier_block *nb) { - raw_notifier_chain_register(&xen_resume_notifier, nb); + if (raw_notifier_chain_register(&xen_resume_notifier, nb)) + pr_warn("Xen resume notifier already registered\n"); } EXPORT_SYMBOL_GPL(xen_resume_notifier_register); diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index bd003ca8acbe..4e83ce95acd1 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -731,10 +731,12 @@ int register_xenstore_notifier(struct notifier_block *nb) { int ret = 0; - if (xenstored_ready > 0) + if (xenstored_ready > 0) { ret = nb->notifier_call(nb, 0, NULL); - else - blocking_notifier_chain_register(&xenstore_chain, nb); + } else { + if (blocking_notifier_chain_register(&xenstore_chain, nb)) + pr_warn("Xenstore notifier already registered\n"); + } return ret; } -- 2.29.2
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |