batman-adv: fix global TT entry deletion
authorAntonio Quartulli <ordex@autistici.org>
Mon, 25 Jun 2012 20:49:51 +0000 (20:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Jun 2012 06:54:32 +0000 (23:54 -0700)
During the last merge involving translation-table.c something went wrong and two
lines disappeared from translation-table.c. This patch recovers them.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/batman-adv/translation-table.c

index e4f27a872c9c1f8bba36b95f43d4b22d5b338d0b..c673b58f3ee14134dbcdc2450566d04f4f911f0f 100644 (file)
@@ -149,6 +149,8 @@ static void batadv_tt_orig_list_entry_free_rcu(struct rcu_head *rcu)
 static void
 batadv_tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry)
 {
+       /* to avoid race conditions, immediately decrease the tt counter */
+       atomic_dec(&orig_entry->orig_node->tt_size);
        call_rcu(&orig_entry->rcu, batadv_tt_orig_list_entry_free_rcu);
 }