af_unix: Clean up SOCK_DEAD error paths in unix_dgram_sendmsg().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 13 Dec 2024 11:08:48 +0000 (20:08 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 Dec 2024 11:08:28 +0000 (12:08 +0100)
commit106d979b85e575b0ab10224fcde5c3eb94566e05
treea15cabada36f722e93f3bc38bc238be3f484022c
parent689c398885cc27d2a5bb2ad5d70324107d4a78ec
af_unix: Clean up SOCK_DEAD error paths in unix_dgram_sendmsg().

When other has SOCK_DEAD in unix_dgram_sendmsg(), we hold
unix_state_lock() for the sender socket first.

However, we do not need it for sk->sk_type.

Let's move the lock down a bit.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/unix/af_unix.c