diff options
Diffstat (limited to 'net/ipv4/inet_diag.c')
| -rw-r--r-- | net/ipv4/inet_diag.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index dc429b6b0ba6..b0170732b5e9 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
| @@ -747,13 +747,14 @@ skip_listen_ht: | |||
| 747 | 747 | ||
| 748 | for (i = s_i; i < hashinfo->ehash_size; i++) { | 748 | for (i = s_i; i < hashinfo->ehash_size; i++) { |
| 749 | struct inet_ehash_bucket *head = &hashinfo->ehash[i]; | 749 | struct inet_ehash_bucket *head = &hashinfo->ehash[i]; |
| 750 | rwlock_t *lock = inet_ehash_lockp(hashinfo, i); | ||
| 750 | struct sock *sk; | 751 | struct sock *sk; |
| 751 | struct hlist_node *node; | 752 | struct hlist_node *node; |
| 752 | 753 | ||
| 753 | if (i > s_i) | 754 | if (i > s_i) |
| 754 | s_num = 0; | 755 | s_num = 0; |
| 755 | 756 | ||
| 756 | read_lock_bh(&head->lock); | 757 | read_lock_bh(lock); |
| 757 | num = 0; | 758 | num = 0; |
| 758 | sk_for_each(sk, node, &head->chain) { | 759 | sk_for_each(sk, node, &head->chain) { |
| 759 | struct inet_sock *inet = inet_sk(sk); | 760 | struct inet_sock *inet = inet_sk(sk); |
| @@ -769,7 +770,7 @@ skip_listen_ht: | |||
| 769 | r->id.idiag_dport) | 770 | r->id.idiag_dport) |
| 770 | goto next_normal; | 771 | goto next_normal; |
| 771 | if (inet_csk_diag_dump(sk, skb, cb) < 0) { | 772 | if (inet_csk_diag_dump(sk, skb, cb) < 0) { |
| 772 | read_unlock_bh(&head->lock); | 773 | read_unlock_bh(lock); |
| 773 | goto done; | 774 | goto done; |
| 774 | } | 775 | } |
| 775 | next_normal: | 776 | next_normal: |
| @@ -791,14 +792,14 @@ next_normal: | |||
| 791 | r->id.idiag_dport) | 792 | r->id.idiag_dport) |
| 792 | goto next_dying; | 793 | goto next_dying; |
| 793 | if (inet_twsk_diag_dump(tw, skb, cb) < 0) { | 794 | if (inet_twsk_diag_dump(tw, skb, cb) < 0) { |
| 794 | read_unlock_bh(&head->lock); | 795 | read_unlock_bh(lock); |
| 795 | goto done; | 796 | goto done; |
| 796 | } | 797 | } |
| 797 | next_dying: | 798 | next_dying: |
| 798 | ++num; | 799 | ++num; |
| 799 | } | 800 | } |
| 800 | } | 801 | } |
| 801 | read_unlock_bh(&head->lock); | 802 | read_unlock_bh(lock); |
| 802 | } | 803 | } |
| 803 | 804 | ||
| 804 | done: | 805 | done: |
