netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: add cleanup in ath10k_sta_state()
@ 2019-08-15 21:04 Wenwen Wang
  2019-09-17 14:11 ` Kalle Valo
  2019-11-13 19:28 ` Bjorn Andersson
  0 siblings, 2 replies; 5+ messages in thread
From: Wenwen Wang @ 2019-08-15 21:04 UTC (permalink / raw)
  To: Wenwen Wang
  Cc: Kalle Valo, David S. Miller,
	open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER,
	open list:NETWORKING DRIVERS (WIRELESS),
	open list:NETWORKING DRIVERS, open list

If 'sta->tdls' is false, no cleanup is executed, leading to memory/resource
leaks, e.g., 'arsta->tx_stats'. To fix this issue, perform cleanup before
go to the 'exit' label.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
---
 drivers/net/wireless/ath/ath10k/mac.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 0606416..f99e6d2 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6548,8 +6548,12 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
 
 		spin_unlock_bh(&ar->data_lock);
 
-		if (!sta->tdls)
+		if (!sta->tdls) {
+			ath10k_peer_delete(ar, arvif->vdev_id, sta->addr);
+			ath10k_mac_dec_num_stations(arvif, sta);
+			kfree(arsta->tx_stats);
 			goto exit;
+		}
 
 		ret = ath10k_wmi_update_fw_tdls_state(ar, arvif->vdev_id,
 						      WMI_TDLS_ENABLE_ACTIVE);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-14  7:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 21:04 [PATCH] ath10k: add cleanup in ath10k_sta_state() Wenwen Wang
2019-09-17 14:11 ` Kalle Valo
2019-11-13 19:28 ` Bjorn Andersson
2019-11-13 19:37   ` Jeffrey Hugo
2019-11-14  7:42   ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).