Message ID | 1457391064-6660-243-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 7c29ec3..b5f9049 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1780,7 +1780,12 @@ restart_locked: goto out_unlock; } - if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { + /* other == sk && unix_peer(other) != sk if + * - unix_peer(sk) == NULL, destination address bound to sk + * - unix_peer(sk) == sk by time of get but disconnected before lock + */ + if (other != sk && + unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { if (timeo) { timeo = unix_wait_for_peer(other, timeo);