diff options
author | 2013-12-30 01:53:57 +0100 | |
---|---|---|
committer | 2013-12-30 01:53:57 +0100 | |
commit | fbd22402164e687fd1be9a1372ee4f6b9373c860 (patch) | |
tree | fd86c8b2f8ed120a2229a1de7959f0d4e56c8008 /net/unix/af_unix.c | |
parent | PM / Sleep: Add macro to define common late/early system PM callbacks (diff) | |
parent | PM / sleep: Fix memory leak in pm_vt_switch_unregister(). (diff) | |
download | wireguard-linux-fbd22402164e687fd1be9a1372ee4f6b9373c860.tar.xz wireguard-linux-fbd22402164e687fd1be9a1372ee4f6b9373c860.zip |
Merge back earlier 'pm-sleep' material.
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 01625ccc3ae6..a0ca162e5bd5 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -530,13 +530,17 @@ static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *, static int unix_seqpacket_recvmsg(struct kiocb *, struct socket *, struct msghdr *, size_t, int); -static void unix_set_peek_off(struct sock *sk, int val) +static int unix_set_peek_off(struct sock *sk, int val) { struct unix_sock *u = unix_sk(sk); - mutex_lock(&u->readlock); + if (mutex_lock_interruptible(&u->readlock)) + return -EINTR; + sk->sk_peek_off = val; mutex_unlock(&u->readlock); + + return 0; } |