net: Make sure BHs are disabled in sock_prot_inuse_add()
authorEric Dumazet <dada1@cosmosbay.com>
Tue, 25 Nov 2008 21:53:27 +0000 (13:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Nov 2008 21:53:27 +0000 (13:53 -0800)
prot->destroy is not called with BH disabled. So we must add
explicit BH disable around call to sock_prot_inuse_add()
in sctp_destroy_sock()

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c

index f03af84edf63c2073efcfcc3f488d1d2cd15048b..ba81fe3ccab83c7268ee685f375c01b75632d862 100644 (file)
@@ -3633,7 +3633,9 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
        ep = sctp_sk(sk)->ep;
        sctp_endpoint_free(ep);
        atomic_dec(&sctp_sockets_allocated);
+       local_bh_disable();
        sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
+       local_bh_enable();
 }
 
 /* API 4.1.7 shutdown() - TCP Style Syntax