]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: ath12k: fix reusing m3 memory
authorBaochen Qiang <baochen.qiang@oss.qualcomm.com>
Wed, 29 Oct 2025 02:07:14 +0000 (10:07 +0800)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 30 Oct 2025 21:55:07 +0000 (14:55 -0700)
commit00575bb44b2c2aa53d0a768de2b80c9c1af0174d
treee79321559a4e624c7828477f2971509915fd4947
parentbe5febd51c478bc8e24ad3480435f2754a403b14
wifi: ath12k: fix reusing m3 memory

During firmware recovery or suspend/resume, m3 memory could be reused if
the size of the new m3 binary is equal to or less than that of the
existing memory. There will be issues for the latter case, since
m3_mem->size will be updated with a smaller value and this value is
eventually used in the free path, where the original total size should be
used instead.

To fix it, add a new member in m3_mem_region structure to track the original
memory size and use it in free path.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3

Fixes: 05090ae82f44 ("wifi: ath12k: check M3 buffer size as well whey trying to reuse it")
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20251029-ath12k-fix-m3-reuse-v1-1-69225bacfc5d@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/qmi.c
drivers/net/wireless/ath/ath12k/qmi.h