summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-08-23 15:34:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-28 10:27:28 +0200
commit2ffabf50bd0038acc0e92fe78915610a7fded182 (patch)
tree86532d9a9ba74f717655849c368ff3ade16ec589 /drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
parentfaff950c80dde6738deb213eb8810c14266e5a42 (diff)
downloadop-kernel-dev-2ffabf50bd0038acc0e92fe78915610a7fded182.zip
op-kernel-dev-2ffabf50bd0038acc0e92fe78915610a7fded182.tar.gz
staging: r8822be: fix memory leak of eeprom_map on error exit return
A memory leak of eeprom_map occurs if the call to halmac_eeprom_parser_88xx fails. Fix this by kfree'ing it before returning. Detected by CoverityScan, CID#1454569 ("Resource leak") Fixes: 938a0447f094 ("staging: r8822be: Add code for halmac sub-driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c')
-rw-r--r--drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
index 0551c47..f623ae5 100644
--- a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
+++ b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
@@ -1950,8 +1950,10 @@ halmac_dump_logical_efuse_map_88xx(struct halmac_adapter *halmac_adapter,
if (halmac_eeprom_parser_88xx(halmac_adapter,
halmac_adapter->hal_efuse_map,
- eeprom_map) != HALMAC_RET_SUCCESS)
+ eeprom_map) != HALMAC_RET_SUCCESS) {
+ kfree(eeprom_map);
return HALMAC_RET_EEPROM_PARSING_FAIL;
+ }
PLATFORM_EVENT_INDICATION(
driver_adapter, HALMAC_FEATURE_DUMP_LOGICAL_EFUSE,
OpenPOWER on IntegriCloud