wifi: ath12k: Fix memory leak in rx_desc and tx_desc
authorRajat Soni <quic_rajson@quicinc.com>
Tue, 22 Aug 2023 13:42:23 +0000 (16:42 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 23 Aug 2023 14:17:44 +0000 (17:17 +0300)
commitafb522b36e76acaa9f8fc06d0a9742d841c47c16
tree90fdcab3cdf4fbeeae578c8057277562ae6dceca
parente10ec6ea612ca54e3266996875b0742619dac20f
wifi: ath12k: Fix memory leak in rx_desc and tx_desc

Currently when ath12k_dp_cc_desc_init() is called we allocate
memory to rx_descs and tx_descs. In ath12k_dp_cc_cleanup(), during
descriptor cleanup rx_descs and tx_descs memory is not freed.

This is cause of memory leak. These allocated memory should be
freed in ath12k_dp_cc_cleanup.

In ath12k_dp_cc_desc_init(), we can save base address of rx_descs
and tx_descs. In ath12k_dp_cc_cleanup(), we can free rx_descs and
tx_descs memory using their base address.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Rajat Soni <quic_rajson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230718053510.30894-1-quic_rajson@quicinc.com
drivers/net/wireless/ath/ath12k/dp.c
drivers/net/wireless/ath/ath12k/dp.h