[PATCH v0 03/42] impi: Check notifier registration return value

From: Borislav Petkov
Date: Mon Nov 08 2021 - 05:12:48 EST


From: Borislav Petkov <bp@xxxxxxx>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: openipmi-developer@xxxxxxxxxxxxxxxxxxxxx
---
drivers/char/ipmi/ipmi_msghandler.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index deed355422f4..9df360b53a90 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -5381,7 +5381,8 @@ static int ipmi_init_msghandler(void)
timer_setup(&ipmi_timer, ipmi_timeout, 0);
mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);

- atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
+ if (atomic_notifier_chain_register(&panic_notifier_list, &panic_block))
+ pr_warn("IPMI panic notifier already registered\n");

initialized = true;

--
2.29.2