mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
net: macvlan: check register_netdevice_notifier() error in macvlan_init_module()
macvlan_init_module() ignores register_netdevice_notifier() errors and continues module initialization, which can leave macvlan 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/20260803085950.142325-1-heminhong@kylinos.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
c1293e4a34
commit
82167f2f0f
|
|
@ -1915,7 +1915,9 @@ static int __init macvlan_init_module(void)
|
|||
{
|
||||
int err;
|
||||
|
||||
register_netdevice_notifier(&macvlan_notifier_block);
|
||||
err = register_netdevice_notifier(&macvlan_notifier_block);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = macvlan_link_register(&macvlan_link_ops);
|
||||
if (err < 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user