[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160711221544.42291-1-li.feng@oracle.com>
Date: Tue, 12 Jul 2016 06:15:44 +0800
From: Feng Li <li.feng@...cle.com>
To: nab@...ux-iscsi.org, agrover@...hat.com, varun@...lsio.com,
herbert@...dor.apana.org.au, roland@...estorage.com
Cc: linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
linux-kernel@...r.kernel.org, Feng Li <lifeng1519@...il.com>
Subject: [PATCH] iscsi-target: fix panic when add the second TCP connection to iSCSI session
From: Feng Li <lifeng1519@...il.com>
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@...il.com>
---
drivers/target/iscsi/iscsi_target_login.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index b5212f0..adf419f 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)
}
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) {
--
2.9.0
Powered by blists - more mailing lists