Skip to content

Commit

Permalink
udp: Should use spin_lock_bh()/spin_unlock_bh() in udp_lib_unhash()
Browse files Browse the repository at this point in the history
Spotted by Alexander Beregalov

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 30, 2008
1 parent 8cf14e3 commit c8db3fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,12 +970,12 @@ void udp_lib_unhash(struct sock *sk)
unsigned int hash = udp_hashfn(sock_net(sk), sk->sk_hash);
struct udp_hslot *hslot = &udptable->hash[hash];

spin_lock(&hslot->lock);
spin_lock_bh(&hslot->lock);
if (sk_del_node_init_rcu(sk)) {
inet_sk(sk)->num = 0;
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
}
spin_unlock(&hslot->lock);
spin_unlock_bh(&hslot->lock);
}
EXPORT_SYMBOL(udp_lib_unhash);

Expand Down

0 comments on commit c8db3fe

Please sign in to comment.