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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index b22775cdcdf..141315ce17d 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1567,17 +1567,21 @@ int sta_info_move_state_checked(struct sta_info *sta,
return -EINVAL;
break;
case IEEE80211_STA_ASSOC:
- if (sta->sta_state == IEEE80211_STA_AUTH)
+ if (sta->sta_state == IEEE80211_STA_AUTH) {
set_bit(WLAN_STA_ASSOC, &sta->_flags);
- else if (sta->sta_state == IEEE80211_STA_AUTHORIZED)
+ } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) {
+ if (sta->sdata->vif.type == NL80211_IFTYPE_AP)
+ atomic_dec(&sta->sdata->u.ap.num_sta_authorized);
clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
- else
+ } else
return -EINVAL;
break;
case IEEE80211_STA_AUTHORIZED:
- if (sta->sta_state == IEEE80211_STA_ASSOC)
+ if (sta->sta_state == IEEE80211_STA_ASSOC) {
+ if (sta->sdata->vif.type == NL80211_IFTYPE_AP)
+ atomic_inc(&sta->sdata->u.ap.num_sta_authorized);
set_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
- else
+ } else
return -EINVAL;
break;
default: