iwlwifi: Fix memory leak in iwl_req_fw_callback()
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 23 Mar 2015 19:07:57 +0000 (14:07 -0500)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 24 Mar 2015 09:40:36 +0000 (11:40 +0200)
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 <Larry.Finger@lwfinger.net>
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>
drivers/net/wireless/iwlwifi/iwl-drv.c

index 996e7f16adf9feafc50cb5d56596a2b80e0cafb3..c7154ac42c8c366d093cfb462a46d9ac98c01e02 100644 (file)
@@ -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: