net/smc: cleanup listen worker mutex unlocking
authorUrsula Braun <ubraun@linux.ibm.com>
Thu, 22 Nov 2018 09:26:40 +0000 (10:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Nov 2018 01:20:32 +0000 (17:20 -0800)
For easier reading move the unlock of mutex smc_create_lgr_pending into
smc_listen_work(), i.e. into the function the mutex has been locked.
No functional change.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c

index 93f7ff8f6e88a85a6b0216c29a065a9ebbe64c5f..7657e249f526c65e6841d4d8c023fb47a5fb5f2c 100644 (file)
@@ -1182,7 +1182,6 @@ static int smc_listen_rdma_finish(struct smc_sock *new_smc,
        return 0;
 
 decline:
-       mutex_unlock(&smc_create_lgr_pending);
        smc_listen_decline(new_smc, reason_code, local_contact);
        return reason_code;
 }
@@ -1282,8 +1281,10 @@ static void smc_listen_work(struct work_struct *work)
 
        /* finish worker */
        if (!ism_supported) {
-               if (smc_listen_rdma_finish(new_smc, &cclc, local_contact))
+               if (smc_listen_rdma_finish(new_smc, &cclc, local_contact)) {
+                       mutex_unlock(&smc_create_lgr_pending);
                        return;
+               }
        }
        smc_conn_save_peer_info(new_smc, &cclc);
        mutex_unlock(&smc_create_lgr_pending);