aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2024-02-07 12:01:19 +0000
committerThomas Zimmermann <[email protected]>2024-02-07 12:02:20 +0000
commit0e85f1ae4ac6dae238b0f35232d1aa52e1b6943f (patch)
tree75b387bc359637c15b90ababb1ff073ca68b5bd8 /net/unix/af_unix.c
parentdrm: mipi-dsi: make mipi_dsi_bus_type const (diff)
parentMerge tag 'drm-misc-next-2024-01-11' of git://anongit.freedesktop.org/drm/drm... (diff)
downloadkernel-0e85f1ae4ac6dae238b0f35232d1aa52e1b6943f.tar.gz
kernel-0e85f1ae4ac6dae238b0f35232d1aa52e1b6943f.zip
Merge drm/drm-next into drm-misc-next
Backmerging to update drm-misc-next to the state of v6.8-rc3. Also fixes a build problem with xe. Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index ac1f2bc18fc9..30b178ebba60 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1344,13 +1344,11 @@ static void unix_state_double_lock(struct sock *sk1, struct sock *sk2)
unix_state_lock(sk1);
return;
}
- if (sk1 < sk2) {
- unix_state_lock(sk1);
- unix_state_lock_nested(sk2);
- } else {
- unix_state_lock(sk2);
- unix_state_lock_nested(sk1);
- }
+ if (sk1 > sk2)
+ swap(sk1, sk2);
+
+ unix_state_lock(sk1);
+ unix_state_lock_nested(sk2, U_LOCK_SECOND);
}
static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2)
@@ -1591,7 +1589,7 @@ restart:
goto out_unlock;
}
- unix_state_lock_nested(sk);
+ unix_state_lock_nested(sk, U_LOCK_SECOND);
if (sk->sk_state != st) {
unix_state_unlock(sk);