[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211108101157.15189-7-bp@alien8.de>
Date: Mon, 8 Nov 2021 11:11:21 +0100
From: Borislav Petkov <bp@...en8.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: linux-arm-kernel@...ts.infradead.org
Subject: [PATCH v0 06/42] firmware: Check notifier registration return value
From: Borislav Petkov <bp@...e.de>
Avoid homegrown notifier registration checks.
No functional changes.
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: linux-arm-kernel@...ts.infradead.org
---
drivers/firmware/arm_scmi/notify.c | 3 ++-
drivers/firmware/google/gsmi.c | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 0efd20cd9d69..f4c42ac00c63 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1358,7 +1358,8 @@ static int scmi_notifier_register(const struct scmi_handle *handle,
if (!hndl)
return -EINVAL;
- blocking_notifier_chain_register(&hndl->chain, nb);
+ if (blocking_notifier_chain_register(&hndl->chain, nb))
+ pr_warn("SCMI notifier already registered\n");
/* Enable events for not pending handlers */
if (!IS_HNDL_PENDING(hndl)) {
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index adaa492c3d2d..a658e7c106c3 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -1030,8 +1030,10 @@ static __init int gsmi_init(void)
register_reboot_notifier(&gsmi_reboot_notifier);
register_die_notifier(&gsmi_die_notifier);
- atomic_notifier_chain_register(&panic_notifier_list,
- &gsmi_panic_notifier);
+
+ if (atomic_notifier_chain_register(&panic_notifier_list,
+ &gsmi_panic_notifier))
+ pr_warn("gsmi panic notifier already registered\n");
printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n");
--
2.29.2
Powered by blists - more mailing lists