aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/translation-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r--net/batman-adv/translation-table.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7fb6726ccbdd..b25e4b328dcb 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -60,10 +60,12 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
60 int required_bytes; 60 int required_bytes;
61 61
62 spin_lock_bh(&bat_priv->hna_lhash_lock); 62 spin_lock_bh(&bat_priv->hna_lhash_lock);
63 rcu_read_lock();
63 hna_local_entry = 64 hna_local_entry =
64 ((struct hna_local_entry *)hash_find(bat_priv->hna_local_hash, 65 ((struct hna_local_entry *)hash_find(bat_priv->hna_local_hash,
65 compare_orig, choose_orig, 66 compare_orig, choose_orig,
66 addr)); 67 addr));
68 rcu_read_unlock();
67 spin_unlock_bh(&bat_priv->hna_lhash_lock); 69 spin_unlock_bh(&bat_priv->hna_lhash_lock);
68 70
69 if (hna_local_entry) { 71 if (hna_local_entry) {
@@ -116,9 +118,11 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
116 /* remove address from global hash if present */ 118 /* remove address from global hash if present */
117 spin_lock_bh(&bat_priv->hna_ghash_lock); 119 spin_lock_bh(&bat_priv->hna_ghash_lock);
118 120
121 rcu_read_lock();
119 hna_global_entry = ((struct hna_global_entry *) 122 hna_global_entry = ((struct hna_global_entry *)
120 hash_find(bat_priv->hna_global_hash, 123 hash_find(bat_priv->hna_global_hash,
121 compare_orig, choose_orig, addr)); 124 compare_orig, choose_orig, addr));
125 rcu_read_unlock();
122 126
123 if (hna_global_entry) 127 if (hna_global_entry)
124 _hna_global_del_orig(bat_priv, hna_global_entry, 128 _hna_global_del_orig(bat_priv, hna_global_entry,
@@ -252,9 +256,11 @@ void hna_local_remove(struct bat_priv *bat_priv,
252 256
253 spin_lock_bh(&bat_priv->hna_lhash_lock); 257 spin_lock_bh(&bat_priv->hna_lhash_lock);
254 258
259 rcu_read_lock();
255 hna_local_entry = (struct hna_local_entry *) 260 hna_local_entry = (struct hna_local_entry *)
256 hash_find(bat_priv->hna_local_hash, compare_orig, choose_orig, 261 hash_find(bat_priv->hna_local_hash, compare_orig, choose_orig,
257 addr); 262 addr);
263 rcu_read_unlock();
258 264
259 if (hna_local_entry) 265 if (hna_local_entry)
260 hna_local_del(bat_priv, hna_local_entry, message); 266 hna_local_del(bat_priv, hna_local_entry, message);
@@ -334,9 +340,11 @@ void hna_global_add_orig(struct bat_priv *bat_priv,
334 spin_lock_bh(&bat_priv->hna_ghash_lock); 340 spin_lock_bh(&bat_priv->hna_ghash_lock);
335 341
336 hna_ptr = hna_buff + (hna_buff_count * ETH_ALEN); 342 hna_ptr = hna_buff + (hna_buff_count * ETH_ALEN);
343 rcu_read_lock();
337 hna_global_entry = (struct hna_global_entry *) 344 hna_global_entry = (struct hna_global_entry *)
338 hash_find(bat_priv->hna_global_hash, compare_orig, 345 hash_find(bat_priv->hna_global_hash, compare_orig,
339 choose_orig, hna_ptr); 346 choose_orig, hna_ptr);
347 rcu_read_unlock();
340 348
341 if (!hna_global_entry) { 349 if (!hna_global_entry) {
342 spin_unlock_bh(&bat_priv->hna_ghash_lock); 350 spin_unlock_bh(&bat_priv->hna_ghash_lock);
@@ -368,9 +376,11 @@ void hna_global_add_orig(struct bat_priv *bat_priv,
368 spin_lock_bh(&bat_priv->hna_lhash_lock); 376 spin_lock_bh(&bat_priv->hna_lhash_lock);
369 377
370 hna_ptr = hna_buff + (hna_buff_count * ETH_ALEN); 378 hna_ptr = hna_buff + (hna_buff_count * ETH_ALEN);
379 rcu_read_lock();
371 hna_local_entry = (struct hna_local_entry *) 380 hna_local_entry = (struct hna_local_entry *)
372 hash_find(bat_priv->hna_local_hash, compare_orig, 381 hash_find(bat_priv->hna_local_hash, compare_orig,
373 choose_orig, hna_ptr); 382 choose_orig, hna_ptr);
383 rcu_read_unlock();
374 384
375 if (hna_local_entry) 385 if (hna_local_entry)
376 hna_local_del(bat_priv, hna_local_entry, 386 hna_local_del(bat_priv, hna_local_entry,
@@ -483,9 +493,11 @@ void hna_global_del_orig(struct bat_priv *bat_priv,
483 493
484 while ((hna_buff_count + 1) * ETH_ALEN <= orig_node->hna_buff_len) { 494 while ((hna_buff_count + 1) * ETH_ALEN <= orig_node->hna_buff_len) {
485 hna_ptr = orig_node->hna_buff + (hna_buff_count * ETH_ALEN); 495 hna_ptr = orig_node->hna_buff + (hna_buff_count * ETH_ALEN);
496 rcu_read_lock();
486 hna_global_entry = (struct hna_global_entry *) 497 hna_global_entry = (struct hna_global_entry *)
487 hash_find(bat_priv->hna_global_hash, compare_orig, 498 hash_find(bat_priv->hna_global_hash, compare_orig,
488 choose_orig, hna_ptr); 499 choose_orig, hna_ptr);
500 rcu_read_unlock();
489 501
490 if ((hna_global_entry) && 502 if ((hna_global_entry) &&
491 (hna_global_entry->orig_node == orig_node)) 503 (hna_global_entry->orig_node == orig_node))
@@ -521,9 +533,11 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv, uint8_t *addr)
521 struct hna_global_entry *hna_global_entry; 533 struct hna_global_entry *hna_global_entry;
522 534
523 spin_lock_bh(&bat_priv->hna_ghash_lock); 535 spin_lock_bh(&bat_priv->hna_ghash_lock);
536 rcu_read_lock();
524 hna_global_entry = (struct hna_global_entry *) 537 hna_global_entry = (struct hna_global_entry *)
525 hash_find(bat_priv->hna_global_hash, 538 hash_find(bat_priv->hna_global_hash,
526 compare_orig, choose_orig, addr); 539 compare_orig, choose_orig, addr);
540 rcu_read_unlock();
527 spin_unlock_bh(&bat_priv->hna_ghash_lock); 541 spin_unlock_bh(&bat_priv->hna_ghash_lock);
528 542
529 if (!hna_global_entry) 543 if (!hna_global_entry)