]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: ath11k: fix memory leak in ath11k_xxx_remove()
authorMiaoqing Pan <quic_miaoqing@quicinc.com>
Thu, 23 Jan 2025 08:49:48 +0000 (16:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:16 +0000 (10:15 +0200)
commita3981850f14ecda037459863f17816961b1c470e
treee79bcbd72d062904f567ecf4805ae6dab90eb84b
parentb92c5179db4b19152c6492d1dfda457bff789272
wifi: ath11k: fix memory leak in ath11k_xxx_remove()

[ Upstream commit efb24b1f0d29537714dd3cc46fb335ac27855251 ]

The firmware memory was allocated in ath11k_pci_probe() or
ath11k_ahb_probe(), but not freed in ath11k_xxx_remove() in case
ATH11K_FLAG_QMI_FAIL bit is set. So call ath11k_fw_destroy() to
free the memory.

Found while fixing the same problem in ath12k:
https://lore.kernel.org/linux-wireless/20240314012746.2729101-1-quic_miaoqing@quicinc.com

Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04546-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1

Signed-off-by: Miaoqing Pan <quic_miaoqing@quicinc.com>
Reviewed-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/20250123084948.1124357-1-quic_miaoqing@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath11k/ahb.c
drivers/net/wireless/ath/ath11k/core.c
drivers/net/wireless/ath/ath11k/fw.c
drivers/net/wireless/ath/ath11k/pci.c