Merge "unix: fix a race condition in unix_release()"

This commit is contained in:
Linux Build Service Account
2014-05-27 22:50:38 -07:00
committed by Gerrit - the friendly Code Review server
+3 -4
View File
@@ -374,7 +374,7 @@ static void unix_sock_destructor(struct sock *sk)
#endif
}
static int unix_release_sock(struct sock *sk, int embrion)
static void unix_release_sock(struct sock *sk, int embrion)
{
struct unix_sock *u = unix_sk(sk);
struct path path;
@@ -443,8 +443,6 @@ static int unix_release_sock(struct sock *sk, int embrion)
if (unix_tot_inflight)
unix_gc(); /* Garbage collect fds */
return 0;
}
static void init_peercred(struct sock *sk)
@@ -694,9 +692,10 @@ static int unix_release(struct socket *sock)
if (!sk)
return 0;
unix_release_sock(sk, 0);
sock->sk = NULL;
return unix_release_sock(sk, 0);
return 0;
}
static int unix_autobind(struct socket *sock)