Commit 4262d35c authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: qedf: missing kref_put in qedf_xmit()

qedf_xmit() calls fc_rport_lookup(), but discards the returned rdata
structure almost immediately without decreasing the refcount.  This leads
to a refcount leak and the rdata never to be freed.
Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 76dbf4ff
...@@ -971,8 +971,10 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp) ...@@ -971,8 +971,10 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp)
"Dropping FCoE frame to %06x.\n", ntoh24(fh->fh_d_id)); "Dropping FCoE frame to %06x.\n", ntoh24(fh->fh_d_id));
kfree_skb(skb); kfree_skb(skb);
rdata = fc_rport_lookup(lport, ntoh24(fh->fh_d_id)); rdata = fc_rport_lookup(lport, ntoh24(fh->fh_d_id));
if (rdata) if (rdata) {
rdata->retries = lport->max_rport_retry_count; rdata->retries = lport->max_rport_retry_count;
kref_put(&rdata->kref, fc_rport_destroy);
}
return -EINVAL; return -EINVAL;
} }
/* End NPIV filtering */ /* End NPIV filtering */
......
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