* [PATCH net] net: failover: check register_netdevice_notifier() error in failover_init()
@ 2026-07-28 3:10 Minhong He
2026-07-30 0:41 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Minhong He @ 2026-07-28 3:10 UTC (permalink / raw)
To: Sridhar Samudrala, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, netdev
Cc: linux-kernel
failover_init() ignores register_netdevice_notifier() errors and always
returns success, which can leave the failover module loaded without its
netdev notifier registered.
Check the error and fail module initialization early.
Signed-off-by: Minhong He <heminhong@kylinos.cn>
---
net/core/failover.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/core/failover.c b/net/core/failover.c
index e43c59cd6868..b28cc6f77204 100644
--- a/net/core/failover.c
+++ b/net/core/failover.c
@@ -302,7 +302,11 @@ EXPORT_SYMBOL_GPL(failover_unregister);
static __init int
failover_init(void)
{
- register_netdevice_notifier(&failover_notifier);
+ int err;
+
+ err = register_netdevice_notifier(&failover_notifier);
+ if (err)
+ return err;
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: failover: check register_netdevice_notifier() error in failover_init()
2026-07-28 3:10 [PATCH net] net: failover: check register_netdevice_notifier() error in failover_init() Minhong He
@ 2026-07-30 0:41 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-07-30 0:41 UTC (permalink / raw)
To: Minhong He
Cc: Sridhar Samudrala, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, netdev, linux-kernel
On Tue, 28 Jul 2026 11:10:33 +0800 Minhong He wrote:
> - register_netdevice_notifier(&failover_notifier);
> + int err;
> +
> + err = register_netdevice_notifier(&failover_notifier);
> + if (err)
> + return err;
>
> return 0;
why add int err:
{
return register_netdevice_notifier(&failover_notifier);
}
--
pw-bot: cr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-30 0:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28 3:10 [PATCH net] net: failover: check register_netdevice_notifier() error in failover_init() Minhong He
2026-07-30 0:41 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox