]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: use WARN_ON_ONCE() in sk_stream_kill_queues()
authorEric Dumazet <edumazet@google.com>
Wed, 8 Jun 2022 16:04:34 +0000 (09:04 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Jun 2022 04:53:55 +0000 (21:53 -0700)
sk_stream_kill_queues() has three checks which have been
useful to detect 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>
net/core/stream.c

index 06b36c730ce8a29bb2d8984495e780931907ca72..ccc083cdef23266dc100368a7183bdeb0e99cbb7 100644 (file)
@@ -196,13 +196,13 @@ void sk_stream_kill_queues(struct sock *sk)
        __skb_queue_purge(&sk->sk_receive_queue);
 
        /* Next, the write queue. */
-       WARN_ON(!skb_queue_empty(&sk->sk_write_queue));
+       WARN_ON_ONCE(!skb_queue_empty(&sk->sk_write_queue));
 
        /* Account for returned memory. */
        sk_mem_reclaim_final(sk);
 
-       WARN_ON(sk->sk_wmem_queued);
-       WARN_ON(sk->sk_forward_alloc);
+       WARN_ON_ONCE(sk->sk_wmem_queued);
+       WARN_ON_ONCE(sk->sk_forward_alloc);
 
        /* It is _impossible_ for the backlog to contain anything
         * when we get here.  All user references to this socket