summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-06-10 07:54:00 +0300
committerJakub Kicinski <kuba@kernel.org>2022-06-10 07:54:01 +0300
commit3000024ccc8e080a4c1fd10bba3fd596f8117a7a (patch)
tree78722b3552044be2170fe2330968b9e7a8251f97 /net/unix/af_unix.c
parentf5f37fc9c4d509bfbd914fbc966100053572e5f0 (diff)
parentfd9ea57f4e9514f9d0f0dec505eefd99a8faa148 (diff)
downloadlinux-3000024ccc8e080a4c1fd10bba3fd596f8117a7a.tar.xz
Merge branch 'net-few-debug-refinements'
Eric Dumazet says: ==================== net: few debug refinements Adopt DEBUG_NET_WARN_ON_ONCE() or WARN_ON_ONCE() in some places where it makes sense. Add checks in napi_consume_skb() and __napi_alloc_skb() Make sure napi_get_frags() does not use page fragments for skb->head. ==================== Link: https://lore.kernel.org/r/20220608160438.1342569-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 2206e6f8902d..3453e0053f76 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -302,7 +302,7 @@ static void __unix_remove_socket(struct sock *sk)
static void __unix_insert_socket(struct sock *sk)
{
- WARN_ON(!sk_unhashed(sk));
+ DEBUG_NET_WARN_ON_ONCE(!sk_unhashed(sk));
sk_add_node(sk, &unix_socket_table[sk->sk_hash]);
}
@@ -554,9 +554,9 @@ static void unix_sock_destructor(struct sock *sk)
u->oob_skb = NULL;
}
#endif
- WARN_ON(refcount_read(&sk->sk_wmem_alloc));
- WARN_ON(!sk_unhashed(sk));
- WARN_ON(sk->sk_socket);
+ DEBUG_NET_WARN_ON_ONCE(refcount_read(&sk->sk_wmem_alloc));
+ DEBUG_NET_WARN_ON_ONCE(!sk_unhashed(sk));
+ DEBUG_NET_WARN_ON_ONCE(sk->sk_socket);
if (!sock_flag(sk, SOCK_DEAD)) {
pr_info("Attempt to release alive unix socket: %p\n", sk);
return;