[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211108101157.15189-12-bp@alien8.de>
Date: Mon, 8 Nov 2021 11:11:26 +0100
From: Borislav Petkov <bp@...en8.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH v0 11/42] misc: 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: Arnd Bergmann <arnd@...db.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/misc/ibmasm/heartbeat.c | 3 ++-
drivers/misc/pvpanic/pvpanic.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/ibmasm/heartbeat.c b/drivers/misc/ibmasm/heartbeat.c
index 59c9a0d95659..f7c22d9a768b 100644
--- a/drivers/misc/ibmasm/heartbeat.c
+++ b/drivers/misc/ibmasm/heartbeat.c
@@ -39,7 +39,8 @@ static struct notifier_block panic_notifier = { panic_happened, NULL, 1 };
void ibmasm_register_panic_notifier(void)
{
- atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier);
+ if (atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier))
+ pr_warn("IBM ASM panic notifier already registered\n");
}
void ibmasm_unregister_panic_notifier(void)
diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
index 4b8f1c7d726d..6e89e8b1beaf 100644
--- a/drivers/misc/pvpanic/pvpanic.c
+++ b/drivers/misc/pvpanic/pvpanic.c
@@ -95,7 +95,8 @@ static int pvpanic_init(void)
INIT_LIST_HEAD(&pvpanic_list);
spin_lock_init(&pvpanic_lock);
- atomic_notifier_chain_register(&panic_notifier_list, &pvpanic_panic_nb);
+ if (atomic_notifier_chain_register(&panic_notifier_list, &pvpanic_panic_nb))
+ pr_warn("PV panic notifier already registered\n");
return 0;
}
--
2.29.2
Powered by blists - more mailing lists