]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ath10k: fix memory leak for tpc_stats_final
authorMiaoqing Pan <miaoqing@codeaurora.org>
Wed, 9 Oct 2019 08:18:09 +0000 (16:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 11:14:24 +0000 (13:14 +0200)
[ Upstream commit 486a8849843455298d49e694cca9968336ce2327 ]

The memory of ar->debug.tpc_stats_final is reallocated every debugfs
reading, it should be freed in ath10k_debug_destroy() for the last
allocation.

Tested HW: QCA9984
Tested FW: 10.4-3.9.0.2-00035

Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath10k/debug.c

index aa333110eaba68a526a294e459c4dde82a606134..4e980e78ba95c3d955ec922b9da48a58e85e871c 100644 (file)
@@ -2365,6 +2365,7 @@ void ath10k_debug_destroy(struct ath10k *ar)
        ath10k_debug_fw_stats_reset(ar);
 
        kfree(ar->debug.tpc_stats);
+       kfree(ar->debug.tpc_stats_final);
 }
 
 int ath10k_debug_register(struct ath10k *ar)