Commit 27bf8882 authored by Yogesh Ashok Powar's avatar Yogesh Ashok Powar Committed by John W. Linville

mac80211: Fixing sparse warning at sta_info.c

The commit 42624d49
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.

 - Replacing rcu_dereference with rcu_dereference_protected
   as suggested by Johannes.
 - Adding mutex_lock/unlock to satisfy the condition at

Cc: Nishant Sarmukadam <>
Reported-by: default avatarJohannes Berg <>
Signed-off-by: default avatarYogesh Ashok Powar <>
Signed-off-by: default avatarJohn W. Linville <>
parent 23de5dc9
......@@ -822,10 +822,13 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
* until the aggregation stop completes. Refer
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)
tid_tx = sta->ampdu_mlme.tid_tx[i];
if (skb_queue_len(&tid_tx->pending)) {
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)
kfree_rcu(tid_tx, rcu_head);
sta_info_free(local, sta);
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment