Thread (2 messages) 2 messages, 2 authors, 6h ago
HOTtoday

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

From: Minhong He <hidden>
Date: 2026-07-28 03:10:45
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.

Check the error and fail module initialization early.

Signed-off-by: Minhong He <redacted>
---
 net/core/failover.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/core/failover.c b/net/core/failover.c
index e43c59cd6868..b28cc6f77204 100644
--- a/net/core/failover.c
+++ b/net/core/failover.c
@@ -302,7 +302,11 @@ EXPORT_SYMBOL_GPL(failover_unregister);
 static __init int
 failover_init(void)
 {
-	register_netdevice_notifier(&failover_notifier);
+	int err;
+
+	err = register_netdevice_notifier(&failover_notifier);
+	if (err)
+		return err;
 
 	return 0;
 }
-- 
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