drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()'
[platform/kernel/linux-starfive.git] / net / unix / af_unix.c
index 3e6eeac..510b1d6 100644 (file)
@@ -212,8 +212,6 @@ static inline bool unix_secdata_eq(struct scm_cookie *scm, struct sk_buff *skb)
 }
 #endif /* CONFIG_SECURITY_NETWORK */
 
-#define unix_peer(sk) (unix_sk(sk)->peer)
-
 static inline int unix_our_peer(struct sock *sk, struct sock *osk)
 {
        return unix_peer(osk) == sk;
@@ -1345,13 +1343,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)
@@ -1584,7 +1580,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);