summaryrefslogtreecommitdiff
path: root/net/batman-adv/translation-table.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-10-30 07:05:07 (GMT)
committerDavid S. Miller <davem@davemloft.net>2011-10-30 07:05:07 (GMT)
commit9eeebb5bc8d984298cba9d12690923cdc09ab173 (patch)
tree2917993c44af42e335533b1018b35c17b3747132 /net/batman-adv/translation-table.c
parent3ddb709af32bacaf78d124420404d1ac19be99b8 (diff)
parent93840ac40bb0d0f177ef8af74e64671be67e8c37 (diff)
downloadlinux-fsl-qoriq-9eeebb5bc8d984298cba9d12690923cdc09ab173.tar.xz
Merge branch 'batman-adv/maint' of git://git.open-mesh.org/linux-merge
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r--net/batman-adv/translation-table.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 873fb3d..c7aafc7 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -137,10 +137,22 @@ static void tt_local_entry_free_ref(struct tt_local_entry *tt_local_entry)
kfree_rcu(tt_local_entry, rcu);
}
+static void tt_global_entry_free_rcu(struct rcu_head *rcu)
+{
+ struct tt_global_entry *tt_global_entry;
+
+ tt_global_entry = container_of(rcu, struct tt_global_entry, rcu);
+
+ if (tt_global_entry->orig_node)
+ orig_node_free_ref(tt_global_entry->orig_node);
+
+ kfree(tt_global_entry);
+}
+
static void tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry)
{
if (atomic_dec_and_test(&tt_global_entry->refcount))
- kfree_rcu(tt_global_entry, rcu);
+ call_rcu(&tt_global_entry->rcu, tt_global_entry_free_rcu);
}
static void tt_local_event(struct bat_priv *bat_priv, const uint8_t *addr,
@@ -710,6 +722,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */
+ if (!hash)
+ return;
+
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
list_lock = &hash->list_locks[i];