* [PATCH net] mpls: add missing unregister_netdevice_notifier to mpls_init
@ 2026-03-11 22:35 Sabrina Dubroca
2026-03-13 2:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Sabrina Dubroca @ 2026-03-11 22:35 UTC (permalink / raw)
To: netdev; +Cc: Sabrina Dubroca, Kuniyuki Iwashima
If mpls_init() fails after registering mpls_dev_notifier, it never
gets removed. Add the missing unregister_netdevice_notifier() call to
the error handling path.
Fixes: 5be2062e3080 ("mpls: Handle error of rtnl_register_module().")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
net/mpls/af_mpls.c | 1 +
1 file changed, 1 insertion(+)
Sorry, Kuniyuki. It's a bit unfair, but prior to your patch, mpls_init
couldn't fail after register_netdevice_notifier :)
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index ef9e749d5e08..d5417688f69e 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -2854,6 +2854,7 @@ static int __init mpls_init(void)
rtnl_af_unregister(&mpls_af_ops);
out_unregister_dev_type:
dev_remove_pack(&mpls_packet_type);
+ unregister_netdevice_notifier(&mpls_dev_notifier);
out_unregister_pernet:
unregister_pernet_subsys(&mpls_net_ops);
goto out;
--
2.51.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-13 2:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 22:35 [PATCH net] mpls: add missing unregister_netdevice_notifier to mpls_init Sabrina Dubroca
2026-03-13 2:50 ` 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