summaryrefslogtreecommitdiff
path: root/net/decnet
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2019-03-31 17:03:02 +0800
committerDavid S. Miller <davem@davemloft.net>2019-04-01 18:10:51 -0700
commit5869b8fadad0be948e310c456f111c4103f5fbfb (patch)
treef74def4622ce45ed84f1ddf9fc34bd85f7e22010 /net/decnet
parentb6163f194c699ff75fa6aa4565b1eb8946c2c652 (diff)
net: use rcu_dereference_protected to fetch sk_dst_cache in sk_destruct
As Eric noticed, in .sk_destruct, sk->sk_dst_cache update is prevented, and no barrier is needed for this. So change to use rcu_dereference_protected() instead of rcu_dereference_check() to fetch sk_dst_cache in there. v1->v2: - no change, repost after net-next is open. Reported-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/af_decnet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index bdccc46a2921..c1fa4785c4c2 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -444,7 +444,7 @@ static void dn_destruct(struct sock *sk)
skb_queue_purge(&scp->other_xmit_queue);
skb_queue_purge(&scp->other_receive_queue);
- dst_release(rcu_dereference_check(sk->sk_dst_cache, 1));
+ dst_release(rcu_dereference_protected(sk->sk_dst_cache, 1));
}
static unsigned long dn_memory_pressure;