]> www.infradead.org Git - users/dwmw2/linux.git/commit
ath10k: fix memory leak of tpc_stats
authorColin Ian King <colin.king@canonical.com>
Sun, 27 May 2018 21:17:02 +0000 (22:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:16 +0000 (16:59 -0700)
commit31a92226a5d59a8538de9fd9a804a75a7ec1d3bd
tree69cc267f737323c0333a92de76803e47cd331133
parent5f2391032c06f71ced9b6cf15226368c50b8a99c
ath10k: fix memory leak of tpc_stats

[ Upstream commit 260e629bbf441585860e21d5e10d2e88437f47c8 ]

Currently tpc_stats is allocated and is leaked on the return
path if num_tx_chain is greater than WMI_TPC_TX_N_CHAIN. Avoid
this leak by performing the check on num_tx_chain before the
allocation of tpc_stats.

Detected by CoverityScan, CID#1469422 ("Resource Leak")
Fixes: 4b190675ad06 ("ath10k: fix kernel panic while reading tpc_stats")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/ath10k/wmi.c