From 4beae6794ea01cba23d9b6b9ed83d94af1c6d4b2 Mon Sep 17 00:00:00 2001 From: Yan Burman Date: Wed, 19 Mar 2014 14:30:54 +0000 Subject: [PATCH] isert: Make sure we cleanup all states if resource allocation fails Signed-off-by: Yan Burman git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5343 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/isert_login.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index 332f07cda..6049e9584 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -243,6 +243,7 @@ int isert_conn_alloc(struct iscsi_session *session, conn->rd_state = 1; isert_dev_release(dev); + isert_set_priv(conn, NULL); res = isert_login_rsp_tx(cmnd, true, false); vunmap(dev->sg_virt); @@ -262,6 +263,7 @@ int isert_conn_alloc(struct iscsi_session *session, goto out; cleanup_iscsi_conn: + conn->rd_state = 0; if (conn->nop_in_interval > 0) cancel_delayed_work_sync(&conn->nop_in_delayed_work); cleanup_conn: