* [PATCH net] net: macvlan: check register_netdevice_notifier() error in macvlan_init_module()
@ 2026-08-03 8:59 Minhong He
2026-08-05 2:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Minhong He @ 2026-08-03 8:59 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev
Cc: linux-kernel
macvlan_init_module() ignores register_netdevice_notifier() errors and
continues module initialization, which can leave macvlan loaded without
its netdev notifier registered.
Check the error and fail module initialization early.
Signed-off-by: Minhong He <heminhong@kylinos.cn>
---
drivers/net/macvlan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 9a4bc99dbf53..4294b433838a 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1906,7 +1906,9 @@ static int __init macvlan_init_module(void)
{
int err;
- register_netdevice_notifier(&macvlan_notifier_block);
+ err = register_netdevice_notifier(&macvlan_notifier_block);
+ if (err)
+ return err;
err = macvlan_link_register(&macvlan_link_ops);
if (err < 0)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: macvlan: check register_netdevice_notifier() error in macvlan_init_module()
2026-08-03 8:59 [PATCH net] net: macvlan: check register_netdevice_notifier() error in macvlan_init_module() Minhong He
@ 2026-08-05 2:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-05 2:00 UTC (permalink / raw)
To: Minhong He
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 3 Aug 2026 16:59:50 +0800 you wrote:
> macvlan_init_module() ignores register_netdevice_notifier() errors and
> continues module initialization, which can leave macvlan loaded without
> its netdev notifier registered.
>
> Check the error and fail module initialization early.
>
> Signed-off-by: Minhong He <heminhong@kylinos.cn>
>
> [...]
Here is the summary with links:
- [net] net: macvlan: check register_netdevice_notifier() error in macvlan_init_module()
https://git.kernel.org/netdev/net-next/c/82167f2f0fde
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-05 2:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 8:59 [PATCH net] net: macvlan: check register_netdevice_notifier() error in macvlan_init_module() Minhong He
2026-08-05 2:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox