]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: Simplify error path in inet_csk_accept().
authorKuniyuki Iwashima <kuniyu@google.com>
Fri, 15 Aug 2025 20:16:11 +0000 (20:16 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 02:20:58 +0000 (19:20 -0700)
commite2afa83296bbac40829624b508492b562a21e4d4
treeb4365f5fa891c595a028f6ee2f587e010ccf992d
parent1068b48ed10805b61be0668cd774af97163479a7
tcp: Simplify error path in inet_csk_accept().

When an error occurs in inet_csk_accept(), what we should do is
only call release_sock() and set the errno to arg->err.

But the path jumps to another label, which introduces unnecessary
initialisation and tests for newsk.

Let's simplify the error path and remove the redundant NULL
checks for newsk.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20250815201712.1745332-4-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/inet_connection_sock.c