summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/cw1200/txrx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/staging/cw1200/txrx.c b/drivers/staging/cw1200/txrx.c
index 1931e3ef88c..0d535f797a8 100644
--- a/drivers/staging/cw1200/txrx.c
+++ b/drivers/staging/cw1200/txrx.c
@@ -717,6 +717,7 @@ void cw1200_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
.txpriv.tid = CW1200_MAX_TID,
.txpriv.rate_id = CW1200_INVALID_RATE_ID,
};
+ struct ieee80211_sta *sta;
struct wsm_tx *wsm;
bool tid_update = 0;
u8 flags = 0;
@@ -761,6 +762,9 @@ void cw1200_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
if (ret)
goto drop;
+ rcu_read_lock();
+ sta = rcu_dereference(t.tx_info->control.sta);
+
spin_lock_bh(&priv->ps_state_lock);
{
tid_update = cw1200_tx_h_pm_state(priv, &t);
@@ -770,11 +774,13 @@ void cw1200_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
spin_unlock_bh(&priv->ps_state_lock);
#if defined(CONFIG_CW1200_USE_STE_EXTENSIONS)
- if (tid_update)
- ieee80211_sta_set_buffered(t.tx_info->control.sta,
+ if (tid_update && sta)
+ ieee80211_sta_set_buffered(sta,
t.txpriv.tid, true);
#endif /* CONFIG_CW1200_USE_STE_EXTENSIONS */
+ rcu_read_unlock();
+
cw1200_bh_wakeup(priv);
return;