linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iscsi-target: fix panic when add the second TCP connection to iSCSI session
@ 2016-07-11 22:15 Feng Li
  2016-07-11 14:23 ` 冯力
  0 siblings, 1 reply; 8+ messages in thread
From: Feng Li @ 2016-07-11 22:15 UTC (permalink / raw)
  To: nab, agrover, varun, herbert, roland
  Cc: linux-scsi, target-devel, linux-kernel, Feng Li

From: Feng Li <lifeng1519@gmail.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@gmail.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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-07-20 20:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-11 22:15 [PATCH] iscsi-target: fix panic when add the second TCP connection to iSCSI session Feng Li
2016-07-11 14:23 ` 冯力
2016-07-12  3:16   ` Feng Li
2016-07-14  9:59     ` Sumit Rai
2016-07-18  2:19       ` Feng Li
2016-07-18 12:40         ` Sumit Rai
2016-07-19  2:10           ` Feng Li
2016-07-20 20:27             ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).