mac80211: Fixing sparse warning at sta_info.c
PATCH v2 1/1 mac80211: Fixing sparse warning at sta_info.c
The commit 42624d4913a00219a8fdbb4bafd634d1d843be85 created following sparse warning
Quoted 3 lines
net/mac80211/sta_info.c:965:24: warning: incorrect type in assignment (different address spaces)net/mac80211/sta_info.c:965:24: expected structtid_ampdu_tx*tid_txnet/mac80211/sta_info.c:965:24: got structtid_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
--- net/mac80211/sta_info.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
net/mac80211/sta_info.c +7 -2
@@ -959,10 +959,13 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)* until the aggregation stop completes. Refer * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936 */ + +mutex_lock (&sta->ampdu_mlme.mtx); +for (i =0 ; i <STA_TID_NUM ; i++) { -if (!sta->ampdu_mlme.tid_tx[i]) + tid_tx =rcu_dereference_protected_tid_tx (sta, i); +if (!tid_tx)continue ; - tid_tx = sta->ampdu_mlme.tid_tx[i];if (skb_queue_len (&tid_tx->pending)) {#ifdef CONFIG_MAC80211_HT_DEBUG wiphy_debug(local->hw.wiphy, "TX A-MPDU purging %d "
@@ -974,6 +977,8 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)kfree_rcu (tid_tx, rcu_head); } +mutex_unlock (&sta->ampdu_mlme.mtx); +__sta_info_free (local, sta);return 0 ;
Signature · 1 line
1.7.5.4
Applying: mac80211: Fixing sparse warning at sta_info.c
error: patch failed: net/mac80211/sta_info.c:974
error: net/mac80211/sta_info.c: patch does not apply
What tree did you use as a base for your patch?
Quoted 58 lines · Yogesh Ashok Powar
The commit
42624d4913a00219a8fdbb4bafd634d1d843be85created following sparse warningQuoted 3 lines
net/mac80211/sta_info.c:965:24: warning: incorrect type in assignment (different address spaces)net/mac80211/sta_info.c:965:24: expected structtid_ampdu_tx*tid_txnet/mac80211/sta_info.c:965:24: got structtid_ampdu_tx[noderef] <asn:4>*<noident>Making use of
rcu_dereference_protectedto fix the problem.V2:
- Replacingrcu_dereferencewithrcu_dereference_protectedas suggested by Johannes.
- Adding mutex_lock/unlock to satisfy the condition atrcu_dereference_protectedCc Nishant Sarmukadam <[email protected]>Reported-by Johannes Berg <[email protected]>Signed-off-by Yogesh Ashok Powar <[email protected]>--- net/mac80211/sta_info.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)net/mac80211/sta_info.c +7
-2@@ -959,10 +959,13 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)* until the aggregation stop completes. Refer * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936 */ + +mutex_lock (&sta->ampdu_mlme.mtx); +for (i =0 ; i <STA_TID_NUM ; i++) { -if (!sta->ampdu_mlme.tid_tx[i]) + tid_tx =rcu_dereference_protected_tid_tx (sta, i); +if (!tid_tx)continue ; - tid_tx = sta->ampdu_mlme.tid_tx[i];if (skb_queue_len (&tid_tx->pending)) {#ifdef CONFIG_MAC80211_HT_DEBUG wiphy_debug(local->hw.wiphy, "TX A-MPDU purging %d "@@ -974,6 +977,8 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)kfree_rcu (tid_tx, rcu_head); } +mutex_unlock (&sta->ampdu_mlme.mtx); +__sta_info_free (local, sta);return 0 ;Signature · 6 lines
1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Quoted 5 lines · John W. Linville
Applying: mac80211: Fixing sparse warning at
sta_info.c
error: patch failed:net/mac80211/sta_info.c:974
error:net/mac80211/sta_info.c: patch does not applyWhat tree did you use as a base for your patch?
NM -- it was simple to fix-up, even if 'git apply' couldn't figure it out...
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.