diff options
author | Yogesh Ashok Powar <yogesh.powar@gmail.com> | 2011-12-16 01:17:15 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-19 15:06:09 -0500 |
commit | 27bf88829f50cf1af2b052ecee2f6f0dbe4a5141 (patch) | |
tree | ac9cdf412a7192fb5eb0cdc2e4cb6ce3c74cbfaf | |
parent | 23de5dc9be28b59a8474bcbba278230c66f0759d (diff) |
mac80211: Fixing sparse warning at sta_info.c
The commit 42624d4913a00219a8fdbb4bafd634d1d843be85
created following sparse warning
>net/mac80211/sta_info.c:965:24: warning: incorrect type in assignment (different address spaces)
>net/mac80211/sta_info.c:965:24: expected struct tid_ampdu_tx *tid_tx
>net/mac80211/sta_info.c:965:24: got struct tid_ampdu_tx [noderef] <asn:4>*<noident>
Making use of rcu_dereference_protected to fix the problem.
V2:
- Replacing rcu_dereference with rcu_dereference_protected
as suggested by Johannes.
- Adding mutex_lock/unlock to satisfy the condition at
rcu_dereference_protected
Cc: Nishant Sarmukadam <nishants@marvell.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/sta_info.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 2db01e9541e7..3d01abb2b813 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -822,10 +822,13 @@ static int __must_check __sta_info_destroy(struct sta_info *sta) | |||
822 | * until the aggregation stop completes. Refer | 822 | * until the aggregation stop completes. Refer |
823 | * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936 | 823 | * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936 |
824 | */ | 824 | */ |
825 | |||
826 | mutex_lock(&sta->ampdu_mlme.mtx); | ||
827 | |||
825 | for (i = 0; i < STA_TID_NUM; i++) { | 828 | for (i = 0; i < STA_TID_NUM; i++) { |
826 | if (!sta->ampdu_mlme.tid_tx[i]) | 829 | tid_tx = rcu_dereference_protected_tid_tx(sta, i); |
830 | if (!tid_tx) | ||
827 | continue; | 831 | continue; |
828 | tid_tx = sta->ampdu_mlme.tid_tx[i]; | ||
829 | if (skb_queue_len(&tid_tx->pending)) { | 832 | if (skb_queue_len(&tid_tx->pending)) { |
830 | #ifdef CONFIG_MAC80211_HT_DEBUG | 833 | #ifdef CONFIG_MAC80211_HT_DEBUG |
831 | wiphy_debug(local->hw.wiphy, "TX A-MPDU purging %d " | 834 | wiphy_debug(local->hw.wiphy, "TX A-MPDU purging %d " |
@@ -837,6 +840,8 @@ static int __must_check __sta_info_destroy(struct sta_info *sta) | |||
837 | kfree_rcu(tid_tx, rcu_head); | 840 | kfree_rcu(tid_tx, rcu_head); |
838 | } | 841 | } |
839 | 842 | ||
843 | mutex_unlock(&sta->ampdu_mlme.mtx); | ||
844 | |||
840 | sta_info_free(local, sta); | 845 | sta_info_free(local, sta); |
841 | 846 | ||
842 | return 0; | 847 | return 0; |