Commit 0e9e3d3b authored by Hillf Danton's avatar Hillf Danton Committed by James Bottomley

[SCSI] libfc: fix memory leakage in remote port

There seems rdata should get put before return.
Signed-off-by: default avatarHillf Danton <dhillf@gmail.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 72e0daad
...@@ -652,7 +652,7 @@ void fc_rport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -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)); FC_RPORT_DBG(rdata, "Received a FLOGI %s\n", fc_els_resp_type(fp));
if (fp == ERR_PTR(-FC_EX_CLOSED)) if (fp == ERR_PTR(-FC_EX_CLOSED))
return; goto put;
mutex_lock(&rdata->rp_mutex); mutex_lock(&rdata->rp_mutex);
...@@ -689,6 +689,7 @@ void fc_rport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -689,6 +689,7 @@ void fc_rport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
fc_frame_free(fp); fc_frame_free(fp);
err: err:
mutex_unlock(&rdata->rp_mutex); mutex_unlock(&rdata->rp_mutex);
put:
kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy); kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
return; return;
bad: bad:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment