Skip to contentSkip to conversation

net: failover: check register_netdevice_notifier() error in failover_init()

PATCH Applied Minhong He 2 participants 2 messages Jul 31 – Aug 5

Subsystems (3)
lore
Share & tools
lore

Minhong He

author
#0 lore raw

PATCH v2 1/1 net: failover: check register_netdevice_notifier() error in failover_init()

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.

---
v2:
- Return register_netdevice_notifier() directly
v1: https://lore.kernel.org/all/[email protected]/

 net/core/failover.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/core/failover.c +1 -3
index e43c59cd6868..4c3894a02cb7 100644
@@ -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);
 
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 31 Jul 2026 11:03:38 +0800 you wrote:

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.

[...]

Here is the summary with links:
- [net,v2] net: failover: check register_netdevice_notifier() error in failover_init()

    https://git.kernel.org/netdev/net-next/c/d13bb65dd2dd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html