diff options
Diffstat (limited to 'net/batman-adv/vis.c')
-rw-r--r-- | net/batman-adv/vis.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c index 355c6e590b0c..8a1b98589d76 100644 --- a/net/batman-adv/vis.c +++ b/net/batman-adv/vis.c | |||
@@ -665,11 +665,12 @@ next: | |||
665 | 665 | ||
666 | hash = bat_priv->tt_local_hash; | 666 | hash = bat_priv->tt_local_hash; |
667 | 667 | ||
668 | spin_lock_bh(&bat_priv->tt_lhash_lock); | ||
669 | for (i = 0; i < hash->size; i++) { | 668 | for (i = 0; i < hash->size; i++) { |
670 | head = &hash->table[i]; | 669 | head = &hash->table[i]; |
671 | 670 | ||
672 | hlist_for_each_entry(tt_local_entry, node, head, hash_entry) { | 671 | rcu_read_lock(); |
672 | hlist_for_each_entry_rcu(tt_local_entry, node, head, | ||
673 | hash_entry) { | ||
673 | entry = (struct vis_info_entry *) | 674 | entry = (struct vis_info_entry *) |
674 | skb_put(info->skb_packet, | 675 | skb_put(info->skb_packet, |
675 | sizeof(*entry)); | 676 | sizeof(*entry)); |
@@ -678,14 +679,12 @@ next: | |||
678 | entry->quality = 0; /* 0 means TT */ | 679 | entry->quality = 0; /* 0 means TT */ |
679 | packet->entries++; | 680 | packet->entries++; |
680 | 681 | ||
681 | if (vis_packet_full(info)) { | 682 | if (vis_packet_full(info)) |
682 | spin_unlock_bh(&bat_priv->tt_lhash_lock); | 683 | goto unlock; |
683 | return 0; | ||
684 | } | ||
685 | } | 684 | } |
685 | rcu_read_unlock(); | ||
686 | } | 686 | } |
687 | 687 | ||
688 | spin_unlock_bh(&bat_priv->tt_lhash_lock); | ||
689 | return 0; | 688 | return 0; |
690 | 689 | ||
691 | unlock: | 690 | unlock: |