From: Larry Finger Date: Mon, 23 Mar 2015 19:07:57 +0000 (-0500) Subject: iwlwifi: Fix memory leak in iwl_req_fw_callback() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a71aaf66725e8fc02253a3bbea15d27e656434fe;p=openwrt%2Fstaging%2Fblogic.git iwlwifi: Fix memory leak in iwl_req_fw_callback() In this routine, kzalloc allocates a memory block. This allocation is freed in the error paths, but not in the normal exit, thus the allocation is leaked. The kmemleak facility was used to find the leak. Signed-off-by: Larry Finger Cc: Johannes Berg Cc: Emmanuel Grumbach Cc: Intel Linux Wireless --- diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 996e7f16adf9..c7154ac42c8c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c @@ -1257,6 +1257,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) op->name, err); #endif } + kfree(pieces); return; try_again: