mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Feng Li <li.feng@oracle.com>
To: nab@linux-iscsi.org, agrover@redhat.com, varun@chelsio.com,
	herbert@gondor.apana.org.au, roland@purestorage.com
Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Feng Li <lifeng1519@gmail.com>
Subject: [PATCH] iscsi-target: fix panic when add the second TCP connection to iSCSI session
Date: Tue, 12 Jul 2016 06:15:44 +0800	[thread overview]
Message-ID: <20160711221544.42291-1-li.feng@oracle.com> (raw)

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

             reply	other threads:[~2016-07-11 14:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 22:15 Feng Li [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160711221544.42291-1-li.feng@oracle.com \
    --to=li.feng@oracle.com \
    --cc=agrover@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=lifeng1519@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=roland@purestorage.com \
    --cc=target-devel@vger.kernel.org \
    --cc=varun@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®