diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index ace2ac8a42f7..bda08a09357d 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1618,7 +1618,8 @@ static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk) | |||
1618 | } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family)); | 1618 | } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family)); |
1619 | 1619 | ||
1620 | if (!sk) { | 1620 | if (!sk) { |
1621 | spin_unlock_bh(&state->udp_table->hash[state->bucket].lock); | 1621 | if (state->bucket < UDP_HTABLE_SIZE) |
1622 | spin_unlock_bh(&state->udp_table->hash[state->bucket].lock); | ||
1622 | return udp_get_first(seq, state->bucket + 1); | 1623 | return udp_get_first(seq, state->bucket + 1); |
1623 | } | 1624 | } |
1624 | return sk; | 1625 | return sk; |
@@ -1636,6 +1637,9 @@ static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos) | |||
1636 | 1637 | ||
1637 | static void *udp_seq_start(struct seq_file *seq, loff_t *pos) | 1638 | static void *udp_seq_start(struct seq_file *seq, loff_t *pos) |
1638 | { | 1639 | { |
1640 | struct udp_iter_state *state = seq->private; | ||
1641 | state->bucket = UDP_HTABLE_SIZE; | ||
1642 | |||
1639 | return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN; | 1643 | return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN; |
1640 | } | 1644 | } |
1641 | 1645 | ||