All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: add cleanup in ath10k_sta_state()
@ 2019-08-15 21:04 ` Wenwen Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Wenwen Wang @ 2019-08-15 21:04 UTC (permalink / raw)
  To: Wenwen Wang
  Cc: open list:NETWORKING DRIVERS,
	open list:NETWORKING DRIVERS WIRELESS, open list,
	open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER,
	David S. Miller, Kalle Valo

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


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

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

Thread overview: 11+ 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-08-15 21:04 ` Wenwen Wang
2019-08-16 10:31 ` Sebastian Gottschall
2019-09-17 14:11 ` Kalle Valo
2019-09-17 14:11 ` Kalle Valo
2019-11-13 19:28 ` Bjorn Andersson
2019-11-13 19:28   ` Bjorn Andersson
2019-11-13 19:37   ` Jeffrey Hugo
2019-11-13 19:37     ` Jeffrey Hugo
2019-11-14  7:42   ` Kalle Valo
2019-11-14  7:42     ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.