[PATCH net 1/1] net/smc: initialize tx_work before llc initial handshake

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Karsten Graul <kgraul@xxxxxxxxxxxxx>

When the llc handshake fails in an early state, the general cleanup
routines may try to cancel an uninitialized worker. Avoid this by
initializing the worker before the llc initial handshake starts.

Signed-off-by: Karsten Graul <kgraul@xxxxxxxxxxxxx>
Signed-off-by: Ursula Braun <ubraun@xxxxxxxxxxxxx>
---
 net/smc/af_smc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 544bab42f925..e96f324dc69f 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -494,6 +494,7 @@ static int smc_connect_rdma(struct smc_sock *smc)
 	rc = smc_clc_send_confirm(smc);
 	if (rc)
 		goto out_err_unlock;
+	smc_tx_init(smc);
 
 	if (local_contact == SMC_FIRST_CONTACT) {
 		/* QP confirmation over RoCE fabric */
@@ -505,9 +506,7 @@ static int smc_connect_rdma(struct smc_sock *smc)
 		if (reason_code > 0)
 			goto decline_rdma_unlock;
 	}
-
 	mutex_unlock(&smc_create_lgr_pending);
-	smc_tx_init(smc);
 
 out_connected:
 	smc_copy_sock_settings_to_clc(smc);
@@ -885,6 +884,7 @@ static void smc_listen_work(struct work_struct *work)
 		reason_code = SMC_CLC_DECL_INTERR;
 		goto decline_rdma_unlock;
 	}
+	smc_tx_init(new_smc);
 
 	if (local_contact == SMC_FIRST_CONTACT) {
 		rc = smc_ib_ready_link(link);
@@ -900,8 +900,6 @@ static void smc_listen_work(struct work_struct *work)
 		if (reason_code > 0)
 			goto decline_rdma_unlock;
 	}
-
-	smc_tx_init(new_smc);
 	mutex_unlock(&smc_create_lgr_pending);
 
 out_connected:
-- 
2.16.3

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux