diff options
Diffstat (limited to 'net/mac80211/ieee80211_rate.c')
-rw-r--r-- | net/mac80211/ieee80211_rate.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c index ebe29b716b27..4de06f128d90 100644 --- a/net/mac80211/ieee80211_rate.c +++ b/net/mac80211/ieee80211_rate.c | |||
@@ -170,9 +170,12 @@ void rate_control_get_rate(struct net_device *dev, | |||
170 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 170 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
171 | struct rate_control_ref *ref = local->rate_ctrl; | 171 | struct rate_control_ref *ref = local->rate_ctrl; |
172 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 172 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
173 | struct sta_info *sta = sta_info_get(local, hdr->addr1); | 173 | struct sta_info *sta; |
174 | int i; | 174 | int i; |
175 | 175 | ||
176 | rcu_read_lock(); | ||
177 | sta = sta_info_get(local, hdr->addr1); | ||
178 | |||
176 | memset(sel, 0, sizeof(struct rate_selection)); | 179 | memset(sel, 0, sizeof(struct rate_selection)); |
177 | 180 | ||
178 | ref->ops->get_rate(ref->priv, dev, sband, skb, sel); | 181 | ref->ops->get_rate(ref->priv, dev, sband, skb, sel); |
@@ -190,8 +193,7 @@ void rate_control_get_rate(struct net_device *dev, | |||
190 | } | 193 | } |
191 | } | 194 | } |
192 | 195 | ||
193 | if (sta) | 196 | rcu_read_unlock(); |
194 | sta_info_put(sta); | ||
195 | } | 197 | } |
196 | 198 | ||
197 | struct rate_control_ref *rate_control_get(struct rate_control_ref *ref) | 199 | struct rate_control_ref *rate_control_get(struct rate_control_ref *ref) |