net, sk_msg: Annotate lockless access to sk_prot on clone
[linux-2.6-microblaze.git] / net / ipv4 / tcp_ulp.c
index 38d3ad1..6c43fa1 100644 (file)
@@ -106,7 +106,8 @@ void tcp_update_ulp(struct sock *sk, struct proto *proto,
 
        if (!icsk->icsk_ulp_ops) {
                sk->sk_write_space = write_space;
-               sk->sk_prot = proto;
+               /* Pairs with lockless read in sk_clone_lock() */
+               WRITE_ONCE(sk->sk_prot, proto);
                return;
        }