]> git.hungrycats.org Git - linux/commitdiff
batman-adv: Fix double-put of vlan object
authorBen Hutchings <ben@decadent.org.uk>
Sun, 26 Jun 2016 09:16:11 +0000 (11:16 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 22 Aug 2016 21:38:24 +0000 (22:38 +0100)
commit baceced93274ff2f846eae991664f9094425ffa8 upstream.

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 for tt_local_entry")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: s/_put/_free_ref/]

net/batman-adv/translation-table.c

index d6560b68692a590f29f966d319d2cc1aeefd4086..7da3f84fff2fd6e98213a8f3489fe171335e3414 100644 (file)
@@ -618,7 +618,6 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
        if (unlikely(hash_added != 0)) {
                /* remove the reference for the hash */
                batadv_tt_local_entry_free_ref(tt_local);
-               batadv_softif_vlan_free_ref(vlan);
                goto out;
        }