mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
net: bonding: check register_netdevice_notifier() error in bonding_init()
bonding_init() ignores register_netdevice_notifier() errors and still returns success, which can leave the bonding module loaded without its netdev notifier registered. Check the error and unwind prior initialization on failure. 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> Acked-by: Jay Vosburgh <jv@jvosburgh.net> Link: https://patch.msgid.link/20260803090012.142638-1-heminhong@kylinos.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ac072a89cb
commit
b16bab3258
|
|
@ -6638,7 +6638,9 @@ static int __init bonding_init(void)
|
|||
flow_keys_bonding_keys,
|
||||
ARRAY_SIZE(flow_keys_bonding_keys));
|
||||
|
||||
register_netdevice_notifier(&bond_netdev_notifier);
|
||||
res = register_netdevice_notifier(&bond_netdev_notifier);
|
||||
if (res)
|
||||
goto err;
|
||||
out:
|
||||
return res;
|
||||
err:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user