summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2024-12-13 14:08:47 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-12-17 14:08:28 +0300
commit689c398885cc27d2a5bb2ad5d70324107d4a78ec (patch)
treeb71e0eea5ba1fd0358d33a9f301421608d3a1fed /net/unix/af_unix.c
parenta700b43358ccc3c5ae857eeea37ff50ce0529b1c (diff)
downloadlinux-689c398885cc27d2a5bb2ad5d70324107d4a78ec.tar.xz
af_unix: Defer sock_put() to clean up path in unix_dgram_sendmsg().
When other has SOCK_DEAD in unix_dgram_sendmsg(), we call sock_put() for it first and then set NULL to other before jumping to the error path. This is to skip sock_put() in the error path. Let's not set NULL to other and defer the sock_put() to the error path to clean up the labels later. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 513d0fd12e6a..b8adfb41d11b 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2075,7 +2075,6 @@ restart_locked:
* datagram error
*/
unix_state_unlock(other);
- sock_put(other);
if (!sk_locked)
unix_state_lock(sk);
@@ -2104,7 +2103,6 @@ restart_locked:
err = -ECONNRESET;
}
- other = NULL;
if (err)
goto out_free;