The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net v2] net: failover: check register_netdevice_notifier() error in failover_init()
@ 2026-07-31  3:03 Minhong He
  2026-08-05  2:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Minhong He @ 2026-07-31  3:03 UTC (permalink / raw)
  To: Sridhar Samudrala, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev
  Cc: linux-kernel

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 <heminhong@kylinos.cn>
---
v2:
- Return register_netdevice_notifier() directly
v1: https://lore.kernel.org/all/20260728031033.76431-1-heminhong@kylinos.cn/

 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-05  2:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31  3:03 [PATCH net v2] net: failover: check register_netdevice_notifier() error in failover_init() Minhong He
2026-08-05  2:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox