]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/tcp_ipv4.c
net: Fix percpu counters deadlock
[linux-2.6-omap-h63xx.git] / net / ipv4 / tcp_ipv4.c
index 10172487921b944d3f82b1d527b4674a9af449a4..9d839fa9331e5845c39b22d07d9d3a93f39634d3 100644 (file)
@@ -51,6 +51,7 @@
  */
 
 
+#include <linux/bottom_half.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/module.h>
@@ -1797,7 +1798,9 @@ static int tcp_v4_init_sock(struct sock *sk)
        sk->sk_sndbuf = sysctl_tcp_wmem[1];
        sk->sk_rcvbuf = sysctl_tcp_rmem[1];
 
+       local_bh_disable();
        percpu_counter_inc(&tcp_sockets_allocated);
+       local_bh_enable();
 
        return 0;
 }