diff options
author | Eric Dumazet <edumazet@google.com> | 2022-06-08 18:04:33 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-10 06:53:55 +0200 |
commit | 3e7f2b8d30883f27ab1157bf3f23f30f1a07bf69 (patch) | |
tree | b290103ba38cc1c3fa889d70700840388a0dd79f /net/ipv4/af_inet.c | |
parent | net: use DEBUG_NET_WARN_ON_ONCE() in dev_loopback_xmit() (diff) | |
download | linux-3e7f2b8d30883f27ab1157bf3f23f30f1a07bf69.tar.xz linux-3e7f2b8d30883f27ab1157bf3f23f30f1a07bf69.zip |
net: use WARN_ON_ONCE() in inet_sock_destruct()
inet_sock_destruct() has four warnings which have been
useful to point to kernel bugs in the past.
However they are potentially a problem because they
could flood the syslog.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 93da9f783bec..30e0e8992085 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -148,10 +148,10 @@ void inet_sock_destruct(struct sock *sk) return; } - WARN_ON(atomic_read(&sk->sk_rmem_alloc)); - WARN_ON(refcount_read(&sk->sk_wmem_alloc)); - WARN_ON(sk->sk_wmem_queued); - WARN_ON(sk_forward_alloc_get(sk)); + WARN_ON_ONCE(atomic_read(&sk->sk_rmem_alloc)); + WARN_ON_ONCE(refcount_read(&sk->sk_wmem_alloc)); + WARN_ON_ONCE(sk->sk_wmem_queued); + WARN_ON_ONCE(sk_forward_alloc_get(sk)); kfree(rcu_dereference_protected(inet->inet_opt, 1)); dst_release(rcu_dereference_protected(sk->sk_dst_cache, 1)); |