Skip to contentSkip to conversation

batman-adv: Fix double-put of vlan object

PATCH Applied Ben Hutchings 3 participants 4 messages Jun 2, 2016 – Jun 6, 2016 Batman advanced

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Fix double-put of vlan object

Commit a33d970d0b54 "batman-adv: Fix reference counting of vlan object for tt_local_entry") makes each batadv_tt_local_entry hold a single reference to a batadv_softif_vlan. In case a new entry cannot be added to the hash table, the error path puts the reference, but the reference will also now be dropped by batadv_tt_local_entry_release().

Fixes a33d970d0b54 ("batman-adv: Fix reference counting of vlan object ...")
Cc Sven Eckelmann <[email protected]>

---
This is untested; I just spotted this apparent oversight while trying to backport the previous fix.

Ben.

 net/batman-adv/translation-table.c | 1 -
 1 file changed, 1 deletion(-)
net/batman-adv/translation-table.c +0 -1
index feaf492b01ca..2068cf6648cb 100644
@@ -691,7 +691,6 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr,
 	if (unlikely(hash_added != 0)) {
 		/* remove the reference for the hash */
 		batadv_tt_local_entry_put(tt_local);
-		batadv_softif_vlan_put(vlan);
 		goto out;
 	}
 
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Friday 03 June 2016 00:00:44 Ben Hutchings wrote:

Commit a33d970d0b54 "batman-adv: Fix reference counting of vlan object for tt_local_entry") makes each batadv_tt_local_entry hold a single reference to a batadv_softif_vlan. In case a new entry cannot be added to the hash table, the error path puts the reference, but the reference will also now be dropped by batadv_tt_local_entry_release().

Quoted 6 lines
Fixes a33d970d0b54 ("batman-adv: Fix reference counting of vlan object

...") Cc: Sven Eckelmann <[email protected]>

---
This is untested; I just spotted this apparent oversight while trying to backport the previous fix.

Yes, you are completely right. I've missed this line in the error handling path for hash_add in batadv_tt_local_add

Kind regards,
Sven

maintainer
#3 lore raw
In reply to Ben Hutchings
Quoted 1 line · On Friday 03 June 2016 00:00:44 Ben Hutchings wrote:
Fixes a33d970d0b54 ("batman-adv: Fix reference counting of vlan object ...")

Btw the Fixes for the batman-adv.git is:

Fixes 20ca393adddf ("batman-adv: Fix reference counting of vlan object for tt_local_entry")

Kind regards,
Sven

#2 lore raw
In reply to Sven Eckelmann
Quoted 14 lines · On Friday, June 03, 2016 02:06:10 Sven Eckelmann wrote:
Quoted 6 lines · On Friday 03 June 2016 00:00:44 Ben Hutchings wrote:

Commit a33d970d0b54 "batman-adv: Fix reference counting of vlan object for tt_local_entry") makes each batadv_tt_local_entry hold a single reference to a batadv_softif_vlan. In case a new entry cannot be added to the hash table, the error path puts the reference, but the reference will also now be dropped by batadv_tt_local_entry_release().

Quoted 6 lines
Fixes a33d970d0b54 ("batman-adv: Fix reference counting of vlan object

...") Cc: Sven Eckelmann <[email protected]>

---
This is untested; I just spotted this apparent oversight while trying to backport the previous fix.

Quoted 4 lines

Yes, you are completely right. I've missed this line in the error handling path for hash_add in batadv_tt_local_add

Applied in revision 22bb8b8.

Thanks,
Marek