@@ -145,6 +145,24 @@ static void __cleanup_single_sta(struct sta_info *sta)
ieee80211_purge_tx_queue(&local->hw, &tid_tx->pending);
kfree(tid_tx);
}
+
+ /*
+ * If we had used sta_info_pre_move_state() then we might not
+ * have gone through the state transitions down again, so do
+ * it here now (and warn if it's inserted).
+ *
+ * This will clear state such as fast TX/RX that may have been
+ * allocated during state transitions.
+ */
+ while (sta->sta_state > IEEE80211_STA_NONE) {
+ int ret;
+
+ WARN_ON_ONCE(test_sta_flag(sta, WLAN_STA_INSERTED));
+
+ ret = sta_info_move_state(sta, sta->sta_state - 1);
+ if (WARN_ONCE(ret, "sta_info_move_state() returned %d\n", ret))
+ break;
+ }
}
static void cleanup_single_sta(struct sta_info *sta)
@@ -258,24 +276,6 @@ 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 we had used sta_info_pre_move_state() then we might not
- * have gone through the state transitions down again, so do
- * it here now (and warn if it's inserted).
- *
- * This will clear state such as fast TX/RX that may have been
- * allocated during state transitions.
- */
- while (sta->sta_state > IEEE80211_STA_NONE) {
- int ret;
-
- WARN_ON_ONCE(test_sta_flag(sta, WLAN_STA_INSERTED));
-
- ret = sta_info_move_state(sta, sta->sta_state - 1);
- if (WARN_ONCE(ret, "sta_info_move_state() returned %d\n", ret))
- break;
- }
-
if (sta->rate_ctrl)
rate_control_free_sta(sta);