diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-15 21:57:42 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-17 09:25:05 +0100 |
commit | 9a25f0cb0d7ee689f54f38890e66bc78520b0c62 (patch) | |
tree | 7b4c80bb16f7d8c22a475b5f68a10163fb1774d2 /net/dccp/ipv6.c | |
parent | tcp: annotate lockless accesses to sk->sk_err_soft (diff) | |
download | linux-9a25f0cb0d7ee689f54f38890e66bc78520b0c62.tar.xz linux-9a25f0cb0d7ee689f54f38890e66bc78520b0c62.zip |
dccp: annotate lockless accesses to sk->sk_err_soft
This field can be read/written without lock synchronization.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv6.c')
-rw-r--r-- | net/dccp/ipv6.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index b9d7c3dd1cb3..47fb10834223 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -174,17 +174,18 @@ static int dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, */ sk_error_report(sk); dccp_done(sk); - } else - sk->sk_err_soft = err; + } else { + WRITE_ONCE(sk->sk_err_soft, err); + } goto out; } if (!sock_owned_by_user(sk) && np->recverr) { sk->sk_err = err; sk_error_report(sk); - } else - sk->sk_err_soft = err; - + } else { + WRITE_ONCE(sk->sk_err_soft, err); + } out: bh_unlock_sock(sk); sock_put(sk); |