summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2024-02-20 09:26:12 -0800
committerLucas De Marchi <lucas.demarchi@intel.com>2024-02-20 09:57:17 -0800
commitfbb944086f2fa36c633be71cfcb38ce9f37eb90e (patch)
tree78428083a0de1e910a2eb025102b462bebdb8bfc /net/unix/af_unix.c
parent0f688c0eb63a643ef0568b29b12cefbb23181e1a (diff)
parent9ac4beb7578a88baa4f7e6a59eeb5be79d7b011a (diff)
downloadlwn-fbb944086f2fa36c633be71cfcb38ce9f37eb90e.tar.gz
lwn-fbb944086f2fa36c633be71cfcb38ce9f37eb90e.zip
Merge drm/drm-next into drm-xe-next
Bring changes from drm-misc-next that got merged in drm-next back to drm-xe so they can be used for additional features. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
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);