summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinhong He <heminhong@kylinos.cn>2026-07-31 11:03:38 +0800
committerJakub Kicinski <kuba@kernel.org>2026-08-04 18:46:34 -0700
commitd13bb65dd2dd0cbfeb8a7aeca9a4afd526eab3ee (patch)
tree84708554128997f467226cdf68ee2b095af4b5d4
parentc0fd47726c9460fbdd1bf26cd0bfcd7dcce8f80b (diff)
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>
-rw-r--r--net/core/failover.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/core/failover.c b/net/core/failover.c
index e43c59cd6868..4c3894a02cb7 100644
--- a/net/core/failover.c
+++ b/net/core/failover.c
@@ -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);