wifi: ath12k: fix invalid m3 buffer address
authorWen Gong <quic_wgong@quicinc.com>
Tue, 10 Oct 2023 07:27:21 +0000 (10:27 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 12 Oct 2023 16:06:29 +0000 (19:06 +0300)
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
drivers/net/wireless/ath/ath12k/qmi.c

index b00d74724aa947067100f24c8836253d2d3242e1..f6e949c618d0ae9943584d9c05361855f92a7025 100644 (file)
@@ -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)