]> git.baikalelectronics.ru Git - kernel.git/commit
iwlwifi: pnvm: Fix a memory leak in 'iwl_pnvm_get_from_fs()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 2 Sep 2021 20:38:11 +0000 (22:38 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 5 Sep 2021 06:11:10 +0000 (09:11 +0300)
commit3f676792998f9e9e5dc18b6e5e94c015eccd9c2a
tree2382fc8f622f1ec8690f1d8e4ca55669c737f437
parent9f5a1593ecb7998648131376db012b3646f13d3b
iwlwifi: pnvm: Fix a memory leak in 'iwl_pnvm_get_from_fs()'

A firmware is requested but never released in this function. This leads to
a memory leak in the normal execution path.

Add the missing 'release_firmware()' call.
Also introduce a temp variable (new_len) in order to keep the value of
'pnvm->size' after the firmware has been released.

Fixes: ecc4b09deb91 ("iwlwifi: pnvm: move file loading code to a separate function")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Luca Coelho <luca@coelho.fi>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1b5d80f54c1dbf85710fd285243932943b498fe7.1630614969.git.christophe.jaillet@wanadoo.fr
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c