diff mbox series

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

Message ID 20211108101157.15189-30-bp@alien8.de (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Borislav Petkov Nov. 8, 2021, 10:11 a.m. UTC
From: Borislav Petkov <bp@suse.de>

Avoid homegrown notifier registration checks.

No functional changes.

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

Patch

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);