Skip to content

Commit 4d0446b

Browse files
q2venkuba-moo
authored andcommitted
af_unix: Set drop reason in unix_sock_destructor().
unix_sock_destructor() is called as sk->sk_destruct() just before the socket is actually freed. Let's use SKB_DROP_REASON_SOCKET_CLOSE for skb_queue_purge(). Signed-off-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c32f0bd commit 4d0446b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/unix/af_unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static void unix_sock_destructor(struct sock *sk)
640640
{
641641
struct unix_sock *u = unix_sk(sk);
642642

643-
skb_queue_purge(&sk->sk_receive_queue);
643+
skb_queue_purge_reason(&sk->sk_receive_queue, SKB_DROP_REASON_SOCKET_CLOSE);
644644

645645
DEBUG_NET_WARN_ON_ONCE(refcount_read(&sk->sk_wmem_alloc));
646646
DEBUG_NET_WARN_ON_ONCE(!sk_unhashed(sk));

0 commit comments

Comments
 (0)