Re: [PATCH v4 02/19] selftests/resctrl: Don't leak buffer in fill_cache()

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

 



Hi Ilpo,

On 7/13/2023 6:19 AM, Ilpo Järvinen wrote:
> The error path in fill_cache() does return before the allocated buffer
> is freed leaking the buffer.
> 
> The leak was introduced when fill_cache_read() started to return errors
> in c7b607fa9325 ("selftests/resctrl: Fix null pointer dereference on

Could you please prefix the sha with "commit" to get a clean
checkpatch.pl check?

> open failed"), before that both fill functions always returned 0.
> 
> Move free() earlier to prevent the mem leak.
> 
> Fixes: c7b607fa9325 ("selftests/resctrl: Fix null pointer dereference on open failed")
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>

Thank you for catching this.

With the changelog update:

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux