Skip to content

Commit

Permalink
Revert "net: do not leave a dangling sk pointer, when socket creation…
Browse files Browse the repository at this point in the history
… fails"

This reverts commit 6cd4a78.

inet/inet6->create() implementations have been fixed to explicitly NULL the
allocated sk object on error.

A warning was put in place to make sure any future changes will not leave
a dangling pointer in pf->create() implementations.

So this code is now redundant.

Suggested-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20241014153808.51894-10-ignat@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Ignat Korchagin authored and Jakub Kicinski committed Oct 16, 2024
1 parent 4815629 commit 18429e6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -3827,9 +3827,6 @@ void sk_common_release(struct sock *sk)

sk->sk_prot->unhash(sk);

if (sk->sk_socket)
sk->sk_socket->sk = NULL;

/*
* In this point socket cannot receive new packets, but it is possible
* that some packets are in flight because some CPU runs receiver and
Expand Down

0 comments on commit 18429e6

Please sign in to comment.