ath10k: fix memory leak on caldata on error exit path
authorColin Ian King <colin.king@canonical.com>
Sat, 3 Sep 2016 16:38:19 +0000 (17:38 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 13 Sep 2016 12:24:20 +0000 (15:24 +0300)
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 <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/pci.c

index 0635995..a6d9c06 100644 (file)
@@ -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;
 }