Re: [Open-FCoE] [PATCH] libfc: fix mem leak in fc_fcp_srr_resp()

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

 



On Fri, Oct 29, 2010 at 5:39 AM, Robert Love <robert.w.love@xxxxxxxxx> wrote:
> On Mon, 2010-10-25 at 20:47 +0800, Hillf Danton wrote:
>> There seems frame should be 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:33:58.000000000 +0800
>> @@ -1685,6 +1685,7 @@ static void fc_fcp_srr_resp(struct fc_se
>> Â Â Â Â*/
>> Â Â Â if (fh->fh_type == FC_TYPE_BLS) {
>> Â Â Â Â Â Â Â fc_fcp_unlock_pkt(fsp);
>> + Â Â Â Â Â Â fc_frame_free(fp);
>> Â Â Â Â Â Â Â return;
>> Â Â Â }
>
> My first thought was that we need to do a fc_fcp_pkt_release here since
> we're doing a fc_fcp_pkt_hold in fc_fcp_srr, but on further

Yes, the pkt hold should get dropped.

> consideration I think this BLS check is unnecessary. fc_exch_recv checks
> for BLS frames before calling any of the response handlers.

If BLS encountered there is a chance in fc_exch_abts_resp() to call
response handler.
And fix looks like,

	if (fh->fh_type == FC_TYPE_BLS) {
		fc_fcp_unlock_pkt(fsp);
+		fc_frame_free(fp);
+		fc_fcp_pkt_release(fsp);
		return;
	}

right?

//Hillf
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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