public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: Fix memory leak in iwl_req_fw_callback()
@ 2015-03-23 19:07 Larry Finger
  2015-03-24  9:43 ` Grumbach, Emmanuel
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2015-03-23 19:07 UTC (permalink / raw)
  To: kvalo
  Cc: linux-wireless, Larry Finger, Johannes Berg, Emmanuel Grumbach,
	Intel Linux Wireless

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index 66ca000..aefdd9b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -1319,6 +1319,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
 				op->name, err);
 #endif
 	}
+	kfree(pieces);
 	return;
 
  try_again:
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-24  9:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 19:07 [PATCH] iwlwifi: Fix memory leak in iwl_req_fw_callback() Larry Finger
2015-03-24  9:43 ` Grumbach, Emmanuel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox