mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Signed-off-by: Xin Long <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
b6163f194c
commit
5869b8fada
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue