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: cdda18fbbefa ("iwlwifi: pnvm: move file loading code to a separate function")
Signed-off-by: Christophe JAILLET <redacted>
---
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
From: Dan Carpenter <hidden> Date: 2021-09-03 08:20:08
On Thu, Sep 02, 2021 at 10:38:11PM +0200, Christophe JAILLET wrote:
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: cdda18fbbefa ("iwlwifi: pnvm: move file loading code to a separate function")
Signed-off-by: Christophe JAILLET <redacted>
Reviewed-by: Dan Carpenter <redacted>
regards,
dan carpenter
On Fri, 2021-09-03 at 11:19 +0300, Dan Carpenter wrote:
On Thu, Sep 02, 2021 at 10:38:11PM +0200, Christophe JAILLET wrote:
quoted
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: cdda18fbbefa ("iwlwifi: pnvm: move file loading code to a separate function")
Signed-off-by: Christophe JAILLET <redacted>
Reviewed-by: Dan Carpenter <redacted>
Acked-by: Luca Coelho <redacted>
Kalle, can you please queue this for v5.15? I'll assign it to you.
Thanks!
--
Cheers,
Luca.
From: Kalle Valo <hidden> Date: 2021-09-05 06:12:04
Christophe JAILLET [off-list ref] wrote:
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: cdda18fbbefa ("iwlwifi: pnvm: move file loading code to a separate function")
Signed-off-by: Christophe JAILLET <redacted>
Reviewed-by: Dan Carpenter <redacted>
Acked-by: Luca Coelho <redacted>