patch-2.1.34 linux/net/netrom/af_netrom.c

Next file: linux/net/netrom/nr_timer.c
Previous file: linux/net/netbeui/af_netbeui.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.33/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
@@ -308,7 +308,8 @@
 		kfree_skb(skb, FREE_READ);
 	}
 
-	if (sk->wmem_alloc != 0 || sk->rmem_alloc != 0) {	/* Defer: outstanding buffers */
+	if (atomic_read(&sk->wmem_alloc) != 0 || atomic_read(&sk->rmem_alloc) != 0) {
+		/* Defer: outstanding buffers */
 		init_timer(&sk->timer);
 		sk->timer.expires  = jiffies + 10 * HZ;
 		sk->timer.function = nr_destroy_timer;
@@ -1183,7 +1184,7 @@
 		case TIOCOUTQ:
 			if ((err = verify_area(VERIFY_WRITE, (void *)arg, sizeof(int))) != 0)
 				return err;
-			amount = sk->sndbuf - sk->wmem_alloc;
+			amount = sk->sndbuf - atomic_read(&sk->wmem_alloc);
 			if (amount < 0)
 				amount = 0;
 			put_user(amount, (int *)arg);
@@ -1277,7 +1278,7 @@
 			s->protinfo.nr->n2count,
 			s->protinfo.nr->n2,
 			s->protinfo.nr->window,
-			s->wmem_alloc, s->rmem_alloc);
+			atomic_read(&s->wmem_alloc), atomic_read(&s->rmem_alloc));
 
 		pos = begin + len;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov