diff options
-rw-r--r-- | net/batman-adv/translation-table.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index ef1acfd7653c..ca537ed2dd0a 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) | |||
137 | kfree_rcu(tt_local_entry, rcu); | 137 | kfree_rcu(tt_local_entry, rcu); |
138 | } | 138 | } |
139 | 139 | ||
140 | static void tt_global_entry_free_rcu(struct rcu_head *rcu) | ||
141 | { | ||
142 | struct tt_global_entry *tt_global_entry; | ||
143 | |||
144 | tt_global_entry = container_of(rcu, struct tt_global_entry, rcu); | ||
145 | |||
146 | if (tt_global_entry->orig_node) | ||
147 | orig_node_free_ref(tt_global_entry->orig_node); | ||
148 | |||
149 | kfree(tt_global_entry); | ||
150 | } | ||
151 | |||
140 | static void tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry) | 152 | static void tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry) |
141 | { | 153 | { |
142 | if (atomic_dec_and_test(&tt_global_entry->refcount)) | 154 | if (atomic_dec_and_test(&tt_global_entry->refcount)) |
143 | kfree_rcu(tt_global_entry, rcu); | 155 | call_rcu(&tt_global_entry->rcu, tt_global_entry_free_rcu); |
144 | } | 156 | } |
145 | 157 | ||
146 | static void tt_local_event(struct bat_priv *bat_priv, const uint8_t *addr, | 158 | static void tt_local_event(struct bat_priv *bat_priv, const uint8_t *addr, |