Skip to content

Commit

Permalink
ath10k: add cleanup in ath10k_sta_state()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
wenwenwang1 authored and Kalle Valo committed Sep 17, 2019
1 parent c413059 commit 334f5b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wireless/ath/ath10k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -6559,8 +6559,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);
Expand Down

0 comments on commit 334f5b6

Please sign in to comment.