summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWen Gong <quic_wgong@quicinc.com>2023-10-10 10:27:21 +0300
committerKalle Valo <quic_kvalo@quicinc.com>2023-10-12 19:06:29 +0300
commitc42c2b8224c40f91f5f4984cc721d33ab10c7d43 (patch)
treec264eb96e5c481b82b64fae2cbe317d179cfb6d2
parent92448f8718baf8a8a940c210f04d0787a52e7507 (diff)
downloadlinux-stable-c42c2b8224c40f91f5f4984cc721d33ab10c7d43.tar.gz
linux-stable-c42c2b8224c40f91f5f4984cc721d33ab10c7d43.tar.bz2
linux-stable-c42c2b8224c40f91f5f4984cc721d33ab10c7d43.zip
wifi: ath12k: fix invalid m3 buffer address
This is to fix m3 buffer reuse issue as m3_mem->size isn't set to zero in the free function, which leads invalid m3 downloading to firmware and firmware crashing. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230721055305.20420-4-quic_wgong@quicinc.com
-rw-r--r--drivers/net/wireless/ath/ath12k/qmi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index b00d74724aa9..f6e949c618d0 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2540,6 +2540,7 @@ static void ath12k_qmi_m3_free(struct ath12k_base *ab)
dma_free_coherent(ab->dev, m3_mem->size,
m3_mem->vaddr, m3_mem->paddr);
m3_mem->vaddr = NULL;
+ m3_mem->size = 0;
}
static int ath12k_qmi_wlanfw_m3_info_send(struct ath12k_base *ab)