mac80211: clean up rate control code
[firefly-linux-kernel-4.4.55.git] / net / mac80211 / sta_info.c
index a090004326641a4848f4a490867786b621731c91..f28fa02b6e54cc8168dc3542cc745596ca570904 100644 (file)
@@ -208,10 +208,8 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
  */
 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
 {
-       if (sta->rate_ctrl) {
+       if (sta->rate_ctrl)
                rate_control_free_sta(sta);
-               rate_control_put(sta->rate_ctrl);
-       }
 
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
        wiphy_debug(local->hw.wiphy, "Destroyed STA %pM\n", sta->sta.addr);
@@ -264,13 +262,11 @@ static int sta_prepare_rate_control(struct ieee80211_local *local,
        if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)
                return 0;
 
-       sta->rate_ctrl = rate_control_get(local->rate_ctrl);
+       sta->rate_ctrl = local->rate_ctrl;
        sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl,
                                                     &sta->sta, gfp);
-       if (!sta->rate_ctrl_priv) {
-               rate_control_put(sta->rate_ctrl);
+       if (!sta->rate_ctrl_priv)
                return -ENOMEM;
-       }
 
        return 0;
 }