]> git.baikalelectronics.ru Git - kernel.git/commit
ice: Fix memory leak in ice_get_orom_civd_data()
authorJianglei Nie <niejianglei2021@163.com>
Sat, 2 Apr 2022 02:17:15 +0000 (10:17 +0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 14 Apr 2022 15:31:01 +0000 (08:31 -0700)
commitbb664867d9a8d52769bf3829912a108b957d7962
tree266fd6148ee81d7776f1ad1e93dbf6c24d235e01
parentcfcf648d44af261590f7dd2b9ee33d467e21c5b3
ice: Fix memory leak in ice_get_orom_civd_data()

A memory chunk was allocated for orom_data in ice_get_orom_civd_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.

Fixes: a4afe8a1c9ab ("ice: reduce time to read Option ROM CIVD data")
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_nvm.c