Commit a81f17c4 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Kelsey Skunberg

batman-adv: Fix orig_node_vlan leak on orig_node_release

BugLink: https://bugs.launchpad.net/bugs/1868629

commit 33fbb1f3 upstream.

batadv_orig_node_new uses batadv_orig_node_vlan_new to allocate a new
batadv_orig_node_vlan and add it to batadv_orig_node::vlan_list. References
to this list have also to be cleaned when the batadv_orig_node is removed.

Fixes: 7ea7b4a1 ("batman-adv: make the TT CRC logic VLAN specific")
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 55813cd5
......@@ -564,6 +564,7 @@ static void batadv_orig_node_release(struct batadv_orig_node *orig_node)
struct hlist_node *node_tmp;
struct batadv_neigh_node *neigh_node;
struct batadv_orig_ifinfo *orig_ifinfo;
struct batadv_orig_node_vlan *vlan;
spin_lock_bh(&orig_node->neigh_list_lock);
......@@ -581,6 +582,13 @@ static void batadv_orig_node_release(struct batadv_orig_node *orig_node)
}
spin_unlock_bh(&orig_node->neigh_list_lock);
spin_lock_bh(&orig_node->vlan_list_lock);
hlist_for_each_entry_safe(vlan, node_tmp, &orig_node->vlan_list, list) {
hlist_del_rcu(&vlan->list);
batadv_orig_node_vlan_free_ref(vlan);
}
spin_unlock_bh(&orig_node->vlan_list_lock);
/* Free nc_nodes */
batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment