summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnat Korchagin <ignat@cloudflare.com>2024-10-14 18:38:08 +0300
committerJakub Kicinski <kuba@kernel.org>2024-10-16 04:43:08 +0300
commit18429e6e0c2ad26250862a786964d8c73400d9a0 (patch)
treed4680ce134db3b56d799c0ea59ca6d38e27f34fb
parent48156296a08c615a6baae514096c4b2e543d1157 (diff)
downloadlinux-18429e6e0c2ad26250862a786964d8c73400d9a0.tar.xz
Revert "net: do not leave a dangling sk pointer, when socket creation fails"
This reverts commit 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2. 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>
-rw-r--r--net/core/sock.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index f8c0d4eda888..756f8e8e0ac7 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -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