Skip to content

Commit

Permalink
[SCSI] libfc: fix memory leakage in remote port
Browse files Browse the repository at this point in the history
There seems rdata should get put before return.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Hillf Danton authored and James Bottomley committed Dec 21, 2010
1 parent 72e0daa commit 0e9e3d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/libfc/fc_rport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -689,6 +689,7 @@ void fc_rport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
fc_frame_free(fp);
err:
mutex_unlock(&rdata->rp_mutex);
put:
kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
return;
bad:
Expand Down

0 comments on commit 0e9e3d3

Please sign in to comment.