net: deal with most data-races in sk_wait_event()
[linux-2.6-microblaze.git] / net / tipc / socket.c
index 37edfe1..dd73d71 100644 (file)
@@ -314,9 +314,9 @@ static void tsk_rej_rx_queue(struct sock *sk, int error)
                tipc_sk_respond(sk, skb, error);
 }
 
-static bool tipc_sk_connected(struct sock *sk)
+static bool tipc_sk_connected(const struct sock *sk)
 {
-       return sk->sk_state == TIPC_ESTABLISHED;
+       return READ_ONCE(sk->sk_state) == TIPC_ESTABLISHED;
 }
 
 /* tipc_sk_type_connectionless - check if the socket is datagram socket