mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
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. This is a future looking check, register_netdevice_notifier() only fails on double registration or if the registered notifier itself returns an error. Signed-off-by: Minhong He <heminhong@kylinos.cn> Link: https://patch.msgid.link/20260803085943.142261-1-heminhong@kylinos.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
e43e9d7cab
commit
c1293e4a34
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user