]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
batman-adv: clean untagged VLAN on netdev registration failure
authorSven Eckelmann <sven@narfation.org>
Sat, 4 Jul 2026 07:46:09 +0000 (09:46 +0200)
committerSven Eckelmann <sven@narfation.org>
Mon, 6 Jul 2026 05:18:58 +0000 (07:18 +0200)
commit8669a550c752d86baebc5fdc83b8ff35c4372c0e
treeb58cd96bbbf001a2e31d58a00988405a30018e1d
parentfdb3be00ba4dafa313e699d6b5b90d13f22f3f25
batman-adv: clean untagged VLAN on netdev registration failure

When an mesh interface is registered, it creates an untagged struct
batadv_meshif_vlan on top of it via the NETDEV_REGISTER notifier. But in
this process, another receiver of this notification can veto the
registration. The netdev registration will be aborted because of this veto.

The register_netdevice() call will try to clean up the net_device using
unregister_netdevice_queue() - which only uses the .priv_destructor to
free private resources. In this situation, .dellink will not be called.

The cleanup of the untagged batadv_meshif_vlan must thefore be done in the
destructor to avoid a leak of this object.

Cc: stable@vger.kernel.org
Fixes: 5d2c05b21337 ("batman-adv: add per VLAN interface attribute framework")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/main.c
net/batman-adv/mesh-interface.c
net/batman-adv/mesh-interface.h