OSDN Git Service

iwlwifi: Fix memory leaks in error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 11 Nov 2021 07:23:11 +0000 (08:23 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 22 Nov 2021 18:39:16 +0000 (20:39 +0200)
commita571bc28326d9f3e13f5f2d9cda2883e0631b0ce
treeec4a9f0151ed9071b0cb4013a745875a92c059d8
parentf5cecf1d4c5ff76172928bc32e99ca56a5ca2f56
iwlwifi: Fix memory leaks in error handling path

Should an error occur (invalid TLV len or memory allocation failure), the
memory already allocated in 'reduce_power_data' should be freed before
returning, otherwise it is leaking.

Fixes: 9dad325f9d57 ("iwlwifi: support loading the reduced power table from UEFI")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1504cd7d842d13ddb8244e18004523128d5c9523.1636615284.git.christophe.jaillet@wanadoo.fr
drivers/net/wireless/intel/iwlwifi/fw/uefi.c