diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index e1f6f225f012..305cba401ae6 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1073,7 +1073,8 @@ static void __sk_free(struct sock *sk) | |||
1073 | if (sk->sk_destruct) | 1073 | if (sk->sk_destruct) |
1074 | sk->sk_destruct(sk); | 1074 | sk->sk_destruct(sk); |
1075 | 1075 | ||
1076 | filter = rcu_dereference(sk->sk_filter); | 1076 | filter = rcu_dereference_check(sk->sk_filter, |
1077 | atomic_read(&sk->sk_wmem_alloc) == 0); | ||
1077 | if (filter) { | 1078 | if (filter) { |
1078 | sk_filter_uncharge(sk, filter); | 1079 | sk_filter_uncharge(sk, filter); |
1079 | rcu_assign_pointer(sk->sk_filter, NULL); | 1080 | rcu_assign_pointer(sk->sk_filter, NULL); |