DORMANTno replies

[PATCH net v2] net: failover: check register_netdevice_notifier() error in failover_init()

From: Minhong He <hidden>
Date: 2026-07-31 03:03:52
Also in: lkml
Subsystem: failover module, networking [general], the rest · Maintainers: Sridhar Samudrala, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

failover_init() ignores register_netdevice_notifier() errors and always
returns success, which can leave the failover module loaded without its
netdev notifier registered.

Return the notifier registration result directly so module initialization
fails when registration fails.

Signed-off-by: Minhong He <redacted>
---
v2:
- Return register_netdevice_notifier() directly
v1: https://lore.kernel.org/all/20260728031033.76431-1-heminhong@kylinos.cn/ (local)

 net/core/failover.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/core/failover.c b/net/core/failover.c
index e43c59cd6868..4c3894a02cb7 100644
--- a/net/core/failover.c
+++ b/net/core/failover.c
@@ -302,9 +302,7 @@ EXPORT_SYMBOL_GPL(failover_unregister);
 static __init int
 failover_init(void)
 {
-	register_netdevice_notifier(&failover_notifier);
-
-	return 0;
+	return register_netdevice_notifier(&failover_notifier);
 }
 module_init(failover_init);
 
-- 
2.25.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