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

G, GurucharanX gurucharanx.g at intel.com
Thu Apr 14 06:41:52 UTC 2022



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Jianglei Nie
> Sent: Friday, April 1, 2022 1:31 PM
> To: Brandeburg, Jesse <jesse.brandeburg at intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; davem at davemloft.net; kuba at kernel.org
> Cc: netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org; linux-
> kernel at vger.kernel.org; Jianglei Nie <niejianglei2021 at 163.com>
> 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 at 163.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_nvm.c | 1 +
>  1 file changed, 1 insertion(+)
> 

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


More information about the Intel-wired-lan mailing list