ath10k: release pre_cal_file while unloading driver
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Wed, 27 Apr 2016 10:56:26 +0000 (16:26 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 6 May 2016 15:55:37 +0000 (18:55 +0300)
Failing to release pre_cal_file caldata on deinit causes memory leak.

Fixes: b131129d9657 ("ath10k: fix calibration init sequence of qca99x0")
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c

index 57d7aad9bc0270a5e681d682218c67235854c29b..ee249e05502668e1cdf782ac684649344b00f2ba 100644 (file)
@@ -686,6 +686,9 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar)
        if (!IS_ERR(ar->cal_file))
                release_firmware(ar->cal_file);
 
+       if (!IS_ERR(ar->pre_cal_file))
+               release_firmware(ar->pre_cal_file);
+
        ath10k_swap_code_seg_release(ar);
 
        ar->normal_mode_fw.fw_file.otp_data = NULL;
@@ -696,6 +699,7 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar)
        ar->normal_mode_fw.fw_file.firmware_len = 0;
 
        ar->cal_file = NULL;
+       ar->pre_cal_file = NULL;
 }
 
 static int ath10k_fetch_cal_file(struct ath10k *ar)