diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index f35502b1c7b1..35adb85c3a42 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1706,7 +1706,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags, goto out; err = -EINVAL; - if (sk->sk_state != TCP_LISTEN) + if (READ_ONCE(sk->sk_state) != TCP_LISTEN) goto out; /* If socket state is TCP_LISTEN it cannot change (for now...),