iscsi-target: nullify session in failed login sequence
authorSagi Grimberg <sagig@mellanox.com>
Mon, 15 Dec 2014 13:08:54 +0000 (15:08 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 16 Dec 2014 07:40:21 +0000 (23:40 -0800)
In case login sequence failed, make sure conn->sess is
NULL before calling wait_conn as some transports (iser)
may rely on that (waiting for session commands).

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_login.c

index 18e2601527dfb028687482f3d900aeef69ded94f..713c0c1877ab8d16bb999ab6738b058e11c82ba9 100644 (file)
@@ -1159,6 +1159,7 @@ void iscsi_target_login_sess_out(struct iscsi_conn *conn,
        }
        kfree(conn->sess->sess_ops);
        kfree(conn->sess);
+       conn->sess = NULL;
 
 old_sess_out:
        iscsi_stop_login_thread_timer(np);