RE: [Intel-wired-lan] [PATCH] ice: Fix memory leak in ice_get_orom_civd_data()

From: G, GurucharanX
Date: Thu Apr 14 2022 - 02:42:02 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> Jianglei Nie
> Sent: Friday, April 1, 2022 1:31 PM
> To: Brandeburg, Jesse <jesse.brandeburg@xxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; davem@xxxxxxxxxxxxx; kuba@xxxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx; intel-wired-lan@xxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; Jianglei Nie <niejianglei2021@xxxxxxx>
> Subject: [Intel-wired-lan] [PATCH] ice: Fix memory leak in
> ice_get_orom_civd_data()
>
> Line 637 allocates a memory chunk for orom_data by vzmalloc(). But when
> ice_read_flash_module() fails, the allocated memory is not freed, which will
> lead to a memory leak.
>
> We can fix it by freeing the orom_data when ce_read_flash_module() fails.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@xxxxxxx>
> ---
> drivers/net/ethernet/intel/ice/ice_nvm.c | 1 +
> 1 file changed, 1 insertion(+)
>

Tested-by: Gurucharan <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)