summaryrefslogtreecommitdiff
blob: a95e94fd9362666c24560a0d8246bca73b955509 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- linux-2.6.9/net/unix/af_unix.c	2004-11-24 08:23:21 -08:00
+++ linux-2.6.9.plasmaroo/net/unix/af_unix.c	2004-11-24 08:23:21 -08:00
@@ -1535,9 +1535,11 @@
 
 	msg->msg_namelen = 0;
 
+	down(&u->readsem);
+
 	skb = skb_recv_datagram(sk, flags, noblock, &err);
 	if (!skb)
-		goto out;
+		goto out_unlock;
 
 	wake_up_interruptible(&u->peer_wait);
 
@@ -1587,6 +1589,8 @@
 
 out_free:
 	skb_free_datagram(sk,skb);
+out_unlock:
+	up(&u->readsem);
 out:
 	return err;
 }