diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-01-17 04:30:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:21:15 -0500 |
commit | 151a02f693b866dd43e147725c818fc1ddb96aa3 (patch) | |
tree | 994099f189a9dd106ea988a9f95c6d1e24e4ec2a /net/mac80211/sta_info.c | |
parent | d5a2ca60e41fec4ede7b82d3608278523cffe77b (diff) |
mac80211: clean up aggregation destruction
Yogesh's patch to destroy aggregation sessions when
stations are destroyed was needed, but unnecessarily
complex. Clean up this code.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index ff11f6bf8266..a09000432664 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -815,35 +815,20 @@ static int __must_check __sta_info_destroy(struct sta_info *sta) | |||
815 | } | 815 | } |
816 | #endif | 816 | #endif |
817 | 817 | ||
818 | /* There could be some memory leaks because of ampdu tx pending queue | 818 | /* |
819 | * not being freed before destroying the station info. | 819 | * Destroy aggregation state here. It would be nice to wait for the |
820 | * | 820 | * driver to finish aggregation stop and then clean up, but for now |
821 | * Make sure that such queues are purged before freeing the station | 821 | * drivers have to handle aggregation stop being requested, followed |
822 | * info. | 822 | * directly by station destruction. |
823 | * TODO: We have to somehow postpone the full destruction | ||
824 | * until the aggregation stop completes. Refer | ||
825 | * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936 | ||
826 | */ | 823 | */ |
827 | |||
828 | mutex_lock(&sta->ampdu_mlme.mtx); | ||
829 | |||
830 | for (i = 0; i < STA_TID_NUM; i++) { | 824 | for (i = 0; i < STA_TID_NUM; i++) { |
831 | tid_tx = rcu_dereference_protected_tid_tx(sta, i); | 825 | tid_tx = rcu_dereference_raw(sta->ampdu_mlme.tid_tx[i]); |
832 | if (!tid_tx) | 826 | if (!tid_tx) |
833 | continue; | 827 | continue; |
834 | if (skb_queue_len(&tid_tx->pending)) { | 828 | __skb_queue_purge(&tid_tx->pending); |
835 | #ifdef CONFIG_MAC80211_HT_DEBUG | 829 | kfree(tid_tx); |
836 | wiphy_debug(local->hw.wiphy, "TX A-MPDU purging %d " | ||
837 | "packets for tid=%d\n", | ||
838 | skb_queue_len(&tid_tx->pending), i); | ||
839 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | ||
840 | __skb_queue_purge(&tid_tx->pending); | ||
841 | } | ||
842 | kfree_rcu(tid_tx, rcu_head); | ||
843 | } | 830 | } |
844 | 831 | ||
845 | mutex_unlock(&sta->ampdu_mlme.mtx); | ||
846 | |||
847 | sta_info_free(local, sta); | 832 | sta_info_free(local, sta); |
848 | 833 | ||
849 | return 0; | 834 | return 0; |