summaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f28fa02b6e54..df8f0a2f0dee 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -403,6 +403,8 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
sta_info_hash_add(local, sta);
list_add(&sta->list, &local->sta_list);
+
+ set_sta_flag(sta, WLAN_STA_INSERTED);
} else {
sta->dummy = false;
}
@@ -707,7 +709,7 @@ static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
return have_buffered;
}
-static int __must_check __sta_info_destroy(struct sta_info *sta)
+int __must_check __sta_info_destroy(struct sta_info *sta)
{
struct ieee80211_local *local;
struct ieee80211_sub_if_data *sdata;
@@ -722,6 +724,8 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
local = sta->local;
sdata = sta->sdata;
+ lockdep_assert_held(&local->sta_mtx);
+
/*
* Before removing the station from the driver and
* rate control, it might still start new aggregation
@@ -763,8 +767,13 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
RCU_INIT_POINTER(sdata->u.vlan.sta, NULL);
- while (sta->sta_state > IEEE80211_STA_NONE)
- sta_info_move_state(sta, sta->sta_state - 1);
+ while (sta->sta_state > IEEE80211_STA_NONE) {
+ int err = sta_info_move_state(sta, sta->sta_state - 1);
+ if (err) {
+ WARN_ON_ONCE(1);
+ break;
+ }
+ }
if (sta->uploaded) {
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@ -1391,8 +1400,8 @@ void ieee80211_sta_set_buffered(struct ieee80211_sta *pubsta,
}
EXPORT_SYMBOL(ieee80211_sta_set_buffered);
-int sta_info_move_state_checked(struct sta_info *sta,
- enum ieee80211_sta_state new_state)
+int sta_info_move_state(struct sta_info *sta,
+ enum ieee80211_sta_state new_state)
{
might_sleep();