RE: [Open-FCoE] [PATCH 1/2] libfc: fix mem leak in fc_tm_done()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Thu, Oct 28, 2010 at 9:55 AM, Mike Christie <michaelc@xxxxxxxxxxx>
> wrote:
> > On 10/27/2010 08:24 PM, Robert Love wrote:
> >>
> >> On Mon, 2010-10-25 at 20:37 +0800, Hillf Danton wrote:
> >>>
> >>> There seems frame should get freed against memory leakage.
> >>>
> >>> Signed-off-by: Hillf Danton<dhillf@xxxxxxxxx>
> >>> ---
> >>>
> >>> --- a/drivers/scsi/libfc/fc_fcp.c    2010-09-13 07:07:38.000000000
> >>> +0800
> >>> +++ b/drivers/scsi/libfc/fc_fcp.c    2010-10-25 20:31:04.000000000
> >>> +0800
> >>> @@ -1294,6 +1294,7 @@ static void fc_tm_done(struct fc_seq *se
> >>> Â Â Â Â */
> >>> Â Â Â Âif (!fsp->seq_ptr || !fsp->wait_for_comp) {
> >>> Â Â Â Â Â Â Â Âspin_unlock_bh(&fsp->scsi_pkt_lock);
> >>
> >> I wonder if this should be a fc_fcp_unlock_pkt(fsp) since we get the
> >> lock with the fc_fcp_lock_pkt(fsp) call above.
> >>
> According to one question a patch, two were delivered, please check them.
> 
> Here I want frame get freed. //Hillf
> 
> >
> > Did I do that. I think you are right. Not sure what happened if it was
> me.
> >

I would think fc_frame_free() be called on all the if () { ..return } cases, the
caller won't do that from fc_exch_recv(), also, frame should be freed after unlock
the fsp:
{
	if (IS_ERR(fp)) 
		goto out;
	if (fc_fcp_lock_pkt(fsp))
		goto out;
	if (!fsp->seq_ptr || !fsp->wait_for_comp)
		goto out_unlock;

	...

out_unlock:
	fc_fcp_unlock_pkt(fsp);
out:
	fc_frame_free(fp);
	       
}

yi
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj·¥Š{±þÇ‹ø¡Ü}©ž²ÆzÚj:+v‰¨þø®w¥þŠàÞ¨è&¢)ß«a¶Úÿûz¹ÞúŽŠÝjÿŠwèf



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux