Skip to content

Commit

Permalink
ath10k: release pre_cal_file while unloading driver
Browse files Browse the repository at this point in the history
Failing to release pre_cal_file caldata on deinit causes memory leak.

Fixes: b131129 ("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>
  • Loading branch information
Rajkumar Manoharan authored and Kalle Valo committed May 6, 2016
1 parent fa7937e commit 9a5f91a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 9a5f91a

Please sign in to comment.