Skip to content

Commit

Permalink
af_unix: use DEBUG_NET_WARN_ON_ONCE()
Browse files Browse the repository at this point in the history
Replace four WARN_ON() that have not triggered recently
with DEBUG_NET_WARN_ON_ONCE().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and Jakub Kicinski committed Jun 10, 2022
1 parent c59f02f commit dd29c67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dd29c67

Please sign in to comment.