From: Hillf Danton Date: Wed, 1 Dec 2010 00:19:04 +0000 (-0800) Subject: [SCSI] libfc: fix memory leakage in remote port X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0e9e3d3b155c35d5750805c2b8bb6d5b6e6a3bfb;p=linux-beck.git [SCSI] libfc: fix memory leakage in remote port There seems rdata should get put before return. Signed-off-by: Hillf Danton Signed-off-by: Robert Love Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index a84ef13ed74a..a7175adab32d 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c @@ -652,7 +652,7 @@ void fc_rport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, FC_RPORT_DBG(rdata, "Received a FLOGI %s\n", fc_els_resp_type(fp)); if (fp == ERR_PTR(-FC_EX_CLOSED)) - return; + goto put; mutex_lock(&rdata->rp_mutex); @@ -689,6 +689,7 @@ out: fc_frame_free(fp); err: mutex_unlock(&rdata->rp_mutex); +put: kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy); return; bad: