From: Colin Ian King Date: Sat, 3 Sep 2016 16:38:19 +0000 (+0100) Subject: ath10k: fix memory leak on caldata on error exit path X-Git-Tag: v4.9-rc1~127^2~176^2~9^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f4761dda2ba3743ceb5eb5b5e7483172927831a;p=platform%2Fkernel%2Flinux-exynos.git ath10k: fix memory leak on caldata on error exit path 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 Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 0635995..a6d9c06 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -2726,7 +2726,7 @@ static int ath10k_pci_hif_fetch_cal_eeprom(struct ath10k *ar, void **data, return 0; err_free: - kfree(data); + kfree(caldata); return -EINVAL; }