public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH v2 1/3] batman-adv: Fix orig_node_vlan leak on orig_node_release
@ 2016-06-30 18:10 Sven Eckelmann
  2016-06-30 18:11 ` [B.A.T.M.A.N.] [PATCH v2 2/3] batman-adv: Fix non-atomic bla_claim::backbone_gw access Sven Eckelmann
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Sven Eckelmann @ 2016-06-30 18:10 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

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: 21a57f6e7a3b ("batman-adv: make the TT CRC logic VLAN specific")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
--
v2:
 - nothing changed
---
 net/batman-adv/originator.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 8755e5c..40626b4 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -786,6 +786,7 @@ static void batadv_orig_node_release(struct kref *ref)
 	struct batadv_neigh_node *neigh_node;
 	struct batadv_orig_node *orig_node;
 	struct batadv_orig_ifinfo *orig_ifinfo;
+	struct batadv_orig_node_vlan *vlan;
 
 	orig_node = container_of(ref, struct batadv_orig_node, refcount);
 
@@ -805,6 +806,13 @@ static void batadv_orig_node_release(struct kref *ref)
 	}
 	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_put(vlan);
+	}
+	spin_unlock_bh(&orig_node->vlan_list_lock);
+
 	/* Free nc_nodes */
 	batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL);
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-07-05  9:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-30 18:10 [B.A.T.M.A.N.] [PATCH v2 1/3] batman-adv: Fix orig_node_vlan leak on orig_node_release Sven Eckelmann
2016-06-30 18:11 ` [B.A.T.M.A.N.] [PATCH v2 2/3] batman-adv: Fix non-atomic bla_claim::backbone_gw access Sven Eckelmann
2016-07-01 13:34   ` Simon Wunderlich
2016-07-01 13:49   ` [B.A.T.M.A.N.] [PATCH v3 2/4] " Sven Eckelmann
2016-07-01 13:54     ` Simon Wunderlich
2016-07-05  9:26       ` Marek Lindner
2016-06-30 18:11 ` [B.A.T.M.A.N.] [PATCH v2 3/3] batman-adv: Fix reference leak in batadv_find_router Sven Eckelmann
2016-07-01 13:30   ` Simon Wunderlich
2016-07-05  9:31   ` Marek Lindner
2016-06-30 19:41 ` [B.A.T.M.A.N.] [PATCH maint v2 4/4] batman-adv: Free last_bonding_candidate on release of orig_node Sven Eckelmann
2016-07-05  9:34   ` Marek Lindner
2016-07-05  9:18 ` [B.A.T.M.A.N.] [PATCH v2 1/3] batman-adv: Fix orig_node_vlan leak on orig_node_release Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox