aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorFeng Li <lifeng1519@gmail.com>2016-07-11 18:15:44 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2016-07-20 16:26:51 -0400
commit8abc718de6e9e52d8a6bfdb735060554aeae25e4 (patch)
treede8c02094723199dc80664d7d54d6f765f3de257 /drivers/target
parent88a678bbc34cecce36bf2c7a8af4cba38f9f77ce (diff)
iscsi-target: Fix panic when adding second TCP connection to iSCSI session
In MC/S scenario, the conn->sess has been set NULL in iscsi_login_non_zero_tsih_s1 when the second connection comes here, then kernel panic. The conn->sess will be assigned in iscsi_login_non_zero_tsih_s2. So we should check whether it's NULL before calling. Signed-off-by: Feng Li <lifeng1519@gmail.com> Tested-by: Sumit Rai <sumit.rai@calsoftinc.com> Cc: stable@vger.kernel.org # 3.14+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/iscsi_target_login.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index b5212f0f9571..adf419fa4291 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -1371,8 +1371,9 @@ static int __iscsi_target_login_thread(struct iscsi_np *np)
1371 } 1371 }
1372 login->zero_tsih = zero_tsih; 1372 login->zero_tsih = zero_tsih;
1373 1373
1374 conn->sess->se_sess->sup_prot_ops = 1374 if (conn->sess)
1375 conn->conn_transport->iscsit_get_sup_prot_ops(conn); 1375 conn->sess->se_sess->sup_prot_ops =
1376 conn->conn_transport->iscsit_get_sup_prot_ops(conn);
1376 1377
1377 tpg = conn->tpg; 1378 tpg = conn->tpg;
1378 if (!tpg) { 1379 if (!tpg) {