Thread (71 messages) 71 messages, 14 authors, 2021-11-29

[PATCH v2 06/45] reboot: Warn if unregister_restart_handler() fails

From: Dmitry Osipenko <digetx@gmail.com>
Date: 2021-10-27 21:18:39
Also in: linux-acpi, linux-m68k, linux-mips, linux-omap, linux-pm, linux-riscv, linux-sh, linux-tegra, lkml, xen-devel
Subsystem: the rest · Maintainer: Linus Torvalds

Emit warning if unregister_restart_handler() fails since it never should
fail. This will ease further API development by catching mistakes early.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 kernel/reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/reboot.c b/kernel/reboot.c
index d39e599c3c99..291d44082f42 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -210,7 +210,7 @@ EXPORT_SYMBOL(register_restart_handler);
  */
 int unregister_restart_handler(struct notifier_block *nb)
 {
-	return atomic_notifier_chain_unregister(&restart_handler_list, nb);
+	return WARN_ON(atomic_notifier_chain_unregister(&restart_handler_list, nb));
 }
 EXPORT_SYMBOL(unregister_restart_handler);
 
-- 
2.33.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help