mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
net: vrf: check register_netdevice_notifier() error in vrf_init_module()
vrf_init_module() ignores register_netdevice_notifier() errors and continues module initialization, which can leave VRF 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> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20260803090002.142453-1-heminhong@kylinos.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
82167f2f0f
commit
ac072a89cb
|
|
@ -1932,7 +1932,9 @@ static int __init vrf_init_module(void)
|
|||
{
|
||||
int rc;
|
||||
|
||||
register_netdevice_notifier(&vrf_notifier_block);
|
||||
rc = register_netdevice_notifier(&vrf_notifier_block);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = register_pernet_subsys(&vrf_net_ops);
|
||||
if (rc < 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user