From 07b012ca56e601cc200fb9e98474e6d9b84e4684 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 29 Jun 2010 10:33:41 +0000 Subject: [PATCH] [PATCH] Session reference count logic error in Qlogic target When double session is found in q2t_create_sess the session object is updated, but after exiting from the function, if the session is not NULL the reference counter is decrement, become zero and then the session is deleted. As done while making a local session we need here to increment the reference count by calling to q2t_sess_get, because at exiting we call to q2t_sess_put. Signed-off-by: Gal Rosen git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1798 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x00-target/qla2x00t.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 2bb5e396e..bf7dfb744 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -574,6 +574,7 @@ static struct q2t_sess *q2t_create_sess(scsi_qla_host_t *ha, fc_port_t *fcport, sess->deleted = 0; } + q2t_sess_get(sess); sess->s_id = fcport->d_id; sess->loop_id = fcport->loop_id; sess->conf_compl_supported = fcport->conf_compl_supported;