diff options
Diffstat (limited to 'net/mac80211/rate.h')
-rw-r--r-- | net/mac80211/rate.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h index 10de668eb9f6..ec198ef6aa8a 100644 --- a/net/mac80211/rate.h +++ b/net/mac80211/rate.h | |||
@@ -52,11 +52,21 @@ static inline void rate_control_rate_init(struct sta_info *sta) | |||
52 | struct ieee80211_sta *ista = &sta->sta; | 52 | struct ieee80211_sta *ista = &sta->sta; |
53 | void *priv_sta = sta->rate_ctrl_priv; | 53 | void *priv_sta = sta->rate_ctrl_priv; |
54 | struct ieee80211_supported_band *sband; | 54 | struct ieee80211_supported_band *sband; |
55 | struct ieee80211_chanctx_conf *chanctx_conf; | ||
55 | 56 | ||
56 | if (!ref) | 57 | if (!ref) |
57 | return; | 58 | return; |
58 | 59 | ||
59 | sband = local->hw.wiphy->bands[local->oper_channel->band]; | 60 | rcu_read_lock(); |
61 | |||
62 | chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf); | ||
63 | if (WARN_ON(!chanctx_conf)) { | ||
64 | rcu_read_unlock(); | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | sband = local->hw.wiphy->bands[chanctx_conf->channel->band]; | ||
69 | rcu_read_unlock(); | ||
60 | 70 | ||
61 | ref->ops->rate_init(ref->priv, sband, ista, priv_sta); | 71 | ref->ops->rate_init(ref->priv, sband, ista, priv_sta); |
62 | set_sta_flag(sta, WLAN_STA_RATE_CONTROL); | 72 | set_sta_flag(sta, WLAN_STA_RATE_CONTROL); |