[PATCH][V2] ath10k: fix memory leak on caldata on error exit path

Subsystems: atheros ath generic utilities, qualcomm atheros ath10k wireless driver, the rest

STALE3687d

2 messages, 2 authors, 2016-09-13 · open the first message on its own page

[PATCH][V2] ath10k: fix memory leak on caldata on error exit path

From: Colin King <hidden>
Date: 2016-09-03 16:39:47

From: Colin Ian King <redacted>

caldata is not being free'd on the error exit path, causing
a memory leak and data definitely should not be freed. Free
caldata instead of data.

Thanks to Kalle Valo for spotting that data should not be
free'd.

Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 9a22c47..afdf0fa 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2725,7 +2725,7 @@ static int ath10k_pci_hif_fetch_cal_eeprom(struct ath10k *ar, void **data,
 	return 0;
 
 err_free:
-	kfree(data);
+	kfree(caldata);
 
 	return -EINVAL;
 }
-- 
2.9.3

Re: [V2] ath10k: fix memory leak on caldata on error exit path

From: Kalle Valo <hidden>
Date: 2016-09-13 12:24:50

Colin Ian King [off-list ref] wrote:
From: Colin Ian King <redacted>

caldata is not being free'd on the error exit path, causing
a memory leak and data definitely should not be freed. Free
caldata instead of data.

Thanks to Kalle Valo for spotting that data should not be
free'd.

Signed-off-by: Colin Ian King <redacted>
Thanks, 1 patch applied to ath-next branch of ath.git:

5f4761dda2ba ath10k: fix memory leak on caldata on error exit path

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/9312163/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help