diff options
author | Feng Li <lifeng1519@gmail.com> | 2016-07-12 06:15:44 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-20 18:09:26 +0200 |
commit | 862312014cfd0770418760d24f980b2f45095e93 (patch) | |
tree | 4416e3a952fb7f1f7b48ce245cd880ef5022df03 | |
parent | 4056337b1e81a1b137aa562133dc5430cd2fd19e (diff) | |
download | lwn-862312014cfd0770418760d24f980b2f45095e93.tar.gz lwn-862312014cfd0770418760d24f980b2f45095e93.zip |
iscsi-target: Fix panic when adding second TCP connection to iSCSI session
commit 8abc718de6e9e52d8a6bfdb735060554aeae25e4 upstream.
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>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 96e78c823d13..316f66172335 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -1357,8 +1357,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) { |