Message ID | 20250507-fw-stats-mem-leak-v1-1-8d4d1d8ec0e8@quicinc.com |
---|---|
State | New |
Headers | show |
Series | [ath-next] wifi: ath12k: fix memory leak in WMI firmware stats | expand |
On Wed, 07 May 2025 22:41:19 +0530, Raj Kumar Bhagat wrote: > Memory allocated for firmware pdev, vdev and beacon statistics > are not released during rmmod. Below kmemleak trace is seen for this > memory leak: > > unreferenced object 0xffff8e76aebdfa00 (size 256): > comm "softirq", pid 0, jiffies 4299272453 > hex dump (first 32 bytes): > 28 19 71 c3 76 8e ff ff 28 19 71 c3 76 8e ff ff (.q.v...(.q.v... > 9f ff ff ff f4 d4 03 00 aa 88 09 00 bd 40 23 00 .............@#. > backtrace (crc dfe1b440): > __kmalloc_cache_noprof+0x2b0/0x370 > ath12k_wmi_tlv_fw_stats_data_parse.isra.0+0x44e/0x730 [ath12k] > ath12k_wmi_tlv_iter+0x5e/0x140 [ath12k] > ath12k_update_stats_event+0x85/0x300 [ath12k] > ath12k_wmi_op_rx+0x624/0xd70 [ath12k] > ath12k_htc_rx_completion_handler+0x1f4/0x330 [ath12k] > ath12k_ce_recv_process_cb+0x218/0x300 [ath12k] > ath12k_pci_ce_workqueue+0x1b/0x30 [ath12k] > process_one_work+0x219/0x680 > bh_worker+0x198/0x1f0 > tasklet_action+0x13/0x30 > handle_softirqs+0xca/0x460 > __irq_exit_rcu+0xbe/0x110 > irq_exit_rcu+0x9/0x30 > common_interrupt+0xa7/0xc0 > asm_common_interrupt+0x26/0x40 > > [...] Applied, thanks! [1/1] wifi: ath12k: fix memory leak in WMI firmware stats commit: 246eb353fbe9136ab3dd2ef979764a13984989e2 Best regards,
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 4dae941c9615cf19e6cc2ed1bd72a6bf1cb812ca..5a14e4241e25d40173a7315f4407826ec412fe59 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -11374,6 +11374,7 @@ static void ath12k_mac_hw_unregister(struct ath12k_hw *ah) for_each_ar(ah, ar, i) { cancel_work_sync(&ar->regd_update_work); ath12k_debugfs_unregister(ar); + ath12k_fw_stats_reset(ar); } ieee80211_unregister_hw(hw);