]> err.no Git - linux-2.6/blobdiff - net/mac80211/ieee80211_rate.c
mac80211: fix mesh_path and sta_info get_by_idx functions
[linux-2.6] / net / mac80211 / ieee80211_rate.c
index ebe29b716b271a8124d5460750b3a5f8d1a349e0..4de06f128d9017102981da7bc4298ed69d63233f 100644 (file)
@@ -170,9 +170,12 @@ void rate_control_get_rate(struct net_device *dev,
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct rate_control_ref *ref = local->rate_ctrl;
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
-       struct sta_info *sta = sta_info_get(local, hdr->addr1);
+       struct sta_info *sta;
        int i;
 
+       rcu_read_lock();
+       sta = sta_info_get(local, hdr->addr1);
+
        memset(sel, 0, sizeof(struct rate_selection));
 
        ref->ops->get_rate(ref->priv, dev, sband, skb, sel);
@@ -190,8 +193,7 @@ void rate_control_get_rate(struct net_device *dev,
                }
        }
 
-       if (sta)
-               sta_info_put(sta);
+       rcu_read_unlock();
 }
 
 struct rate_control_ref *rate_control_get(struct rate_control_ref *ref)