From 2cfd09c8de73b80d83f657e6114829cdd4fc4d70 Mon Sep 17 00:00:00 2001 From: Yan Burman Date: Sun, 16 Nov 2014 13:22:42 +0000 Subject: [PATCH] isert: Fix resource leak upon unreachable event Unreachable event caused by crash of initiator while in connection establishment flow, would cause leak of connections. Signed-off-by: Yan Burman git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5859 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 5a40dbf3c..acf693705 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -1079,7 +1079,6 @@ static struct isert_connection *isert_conn_create(struct rdma_cm_id *cm_id, } kref_init(&isert_conn->kref); - kref_get(&isert_conn->kref); TRACE_EXIT(); return isert_conn; @@ -1315,6 +1314,7 @@ static int isert_cm_connect_handler(struct rdma_cm_id *cm_id, if (unlikely(ret)) goto out; + kref_get(&isert_conn->kref); kref_get(&isert_conn->kref); /* notify upper layer */ ret = isert_conn_established(&isert_conn->iscsi,