diff options
author | Feng Li <lifeng1519@gmail.com> | 2016-07-12 06:15:44 +0800 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-08-19 23:07:58 -0400 |
commit | 7f5a3c76f3d4fe9a0aa9c659249757a2b31db42f (patch) | |
tree | 524e07d5c90d6badc821f660d99c4938fc816aef | |
parent | 634a3fc5f16470e9b78ccd7ce643305122d5ebb2 (diff) |
iscsi-target: Fix panic when adding second TCP connection to iSCSI session
[ Upstream commit 8abc718de6e9e52d8a6bfdb735060554aeae25e4 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.c | 5 |
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 39654e917cd8..e929205e28c6 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -1415,8 +1415,9 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) } login->zero_tsih = zero_tsih; - conn->sess->se_sess->sup_prot_ops = - conn->conn_transport->iscsit_get_sup_prot_ops(conn); + if (conn->sess) + conn->sess->se_sess->sup_prot_ops = + conn->conn_transport->iscsit_get_sup_prot_ops(conn); tpg = conn->tpg; if (!tpg) { |