[dpdk-dev] [PATCH] power: fix resource leak

Burakov, Anatoly anatoly.burakov at intel.com
Wed Apr 14 12:00:36 CEST 2021


On 14-Apr-21 10:24 AM, Pattan, Reshma wrote:
> 
> 
>> -----Original Message-----
>> From: Burakov, Anatoly <anatoly.burakov at intel.com>
>>   base_max_ratio =
>>   strtoul(buf_base, NULL,
>> POWER_CONVERT_TO_DECIMAL)
>>   / BUS_FREQ;
>> +/* not needed any more */
>> +fclose(f_base_max);
>> +f_base_max = NULL;
> 
> Should this be moved before FOPS_OR_NULL_GOTO() call ?
> 

No, otherwise we wouldn't be able to read the data. It *could* be moved 
to the end, but then we'd have to modify the rest of the logic as well, 
because right after this there are unconditional returns there. All of 
this is addressed in a refactor patch [1], this is just fixing a bug and 
nothing else.

[1] 
http://patches.dpdk.org/project/dpdk/patch/20210402092701.258316-1-anatoly.burakov@intel.com/

-- 
Thanks,
Anatoly


More information about the dev mailing list