mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 18:43:12 -04:00
net: failover: check register_netdevice_notifier() error in failover_init()
failover_init() ignores register_netdevice_notifier() errors and always returns success, which can leave the failover module loaded without its netdev notifier registered. Return the notifier registration result directly so module initialization fails when registration fails. 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/20260731030338.82508-1-heminhong@kylinos.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
c0fd47726c
commit
d13bb65dd2
@@ -302,9 +302,7 @@ EXPORT_SYMBOL_GPL(failover_unregister);
|
||||
static __init int
|
||||
failover_init(void)
|
||||
{
|
||||
register_netdevice_notifier(&failover_notifier);
|
||||
|
||||
return 0;
|
||||
return register_netdevice_notifier(&failover_notifier);
|
||||
}
|
||||
module_init(failover_init);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user