[PATCH v0 29/42] arm64: Check notifier registration return value

Borislav Petkov bp at alien8.de
Mon Nov 8 02:11:44 PST 2021


From: Borislav Petkov <bp at suse.de>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp at suse.de>
Cc: linux-arm-kernel at lists.infradead.org
---
 arch/arm64/kernel/setup.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index be5f85b0a24d..e66af9de7cd7 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -440,8 +440,10 @@ static struct notifier_block arm64_panic_block = {
 
 static int __init register_arm64_panic_block(void)
 {
-	atomic_notifier_chain_register(&panic_notifier_list,
-				       &arm64_panic_block);
+	if (atomic_notifier_chain_register(&panic_notifier_list,
+					   &arm64_panic_block))
+		pr_warn("Panic notifier already registered\n");
+
 	return 0;
 }
 device_initcall(register_arm64_panic_block);
-- 
2.29.2




More information about the linux-arm-kernel mailing list