Skip to content

Commit 0a186b4

Browse files
T-Xsimonwunderlich
authored andcommitted
batman-adv: mcast: fix memory leak on deleting a batman-adv interface
The batman-adv multicast tracker TVLV handler is registered for the new batman-adv multicast packet type upon creating a batman-adv interface, but not unregistered again upon the interface's deletion, leading to a memory leak. Fix this memory leak by calling the according TVLV handler unregister routine for the multicast tracker TVLV upon batman-adv interface deletion. Fixes: 07afe1b ("batman-adv: mcast: implement multicast packet reception and forwarding") Reported-and-tested-by: [email protected] Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Linus Lüssing <[email protected]> Signed-off-by: Sven Eckelmann <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]>
1 parent 59f7ea7 commit 0a186b4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/batman-adv/multicast.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,6 +2175,7 @@ void batadv_mcast_free(struct batadv_priv *bat_priv)
21752175
cancel_delayed_work_sync(&bat_priv->mcast.work);
21762176

21772177
batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
2178+
batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST_TRACKER, 1);
21782179
batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
21792180

21802181
/* safely calling outside of worker, as worker was canceled above */

0 commit comments

Comments
 (0)