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:
Minhong He
2026-07-31 11:03:38 +08:00
committed by Jakub Kicinski
parent c0fd47726c
commit d13bb65dd2

View File

@@ -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);