Skip to contentSkip to conversation

net: team: check register_netdevice_notifier() error in team_module_init()

PATCH Applied Minhong He 2 participants 2 messages Aug 3 – Aug 5

Subsystems (3)
lore
Share & tools
lore

Minhong He

author
#0 lore raw

PATCH 1/1 net: team: check register_netdevice_notifier() error in team_module_init()

team_module_init() ignores register_netdevice_notifier() errors and continues module initialization, which can leave the team module loaded without its netdev notifier registered.

Check the error and fail module initialization early.

---
 drivers/net/team/team_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/team/team_core.c +3 -1
index feaa75fbf8fc..beffbe450612 100644
@@ -3229,7 +3229,9 @@ static int __init team_module_init(void)
 {
 	int err;
 
-	register_netdevice_notifier(&team_notifier_block);
+	err = register_netdevice_notifier(&team_notifier_block);
+	if (err)
+		return err;
 
 	err = rtnl_link_register(&team_link_ops);
 	if (err)
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 9 lines · On Mon, 3 Aug 2026 16:59:43 +0800 you wrote:

team_module_init() ignores register_netdevice_notifier() errors and continues module initialization, which can leave the team module loaded without its netdev notifier registered.

Check the error and fail module initialization early.

[...]

Here is the summary with links:
- [net] net: team: check register_netdevice_notifier() error in team_module_init()

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

You are awesome, thank you!

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