[PATCH v0 26/42] alpha: Check notifier registration return value

Borislav Petkov
2021-11-08T10:11:41Z

From: Borislav Petkov <bp@suse.de>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: linux-alpha@vger.kernel.org
---
arch/alpha/kernel/setup.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index b4fbbba30aa2..520c08031137 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -465,8 +465,9 @@ setup_arch(char **cmdline_p)
}

/* Register a call for panic conditions. */
- atomic_notifier_chain_register(&panic_notifier_list,
- &alpha_panic_block);
+ if (atomic_notifier_chain_register(&panic_notifier_list,
+ &alpha_panic_block))
+ pr_warn("Panic notifier already registered\n");

#ifndef alpha_using_srm
/* Assume that we've booted from SRM if we haven't booted from MILO.
--
2.29.2