diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2012-01-27 05:02:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-30 15:48:18 -0500 |
commit | 2ab694d302b489c5aa49c360dc97149b77c96586 (patch) | |
tree | 18ff458004469014eaafe24618a9bdd45a11d780 /net/mac80211/sta_info.c | |
parent | 83d5cc012441531ab0bf6f99881958e964e9cf11 (diff) |
mac80211: Fix incorrect num_sta_ps decrement in __sta_info_destroy
When WLAN_STA_PS_DRIVER is set by ieee80211_sta_block_awake the
num_sta_ps counter is not incremented. Hence, we shouldn't decrement
it in __sta_info_destroy if only WLAN_STA_PS_DRIVER is set. This
could result in an incorrect num_sta_ps counter leading to strange side
effects with associated powersaving clients.
Fix this by only decrementing num_sta_ps when WLAN_STA_PS_STA was set
before.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index df8f0a2f0dee..0c79593b1bbf 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -750,12 +750,10 @@ int __must_check __sta_info_destroy(struct sta_info *sta) | |||
750 | 750 | ||
751 | sta->dead = true; | 751 | sta->dead = true; |
752 | 752 | ||
753 | if (test_sta_flag(sta, WLAN_STA_PS_STA) || | 753 | if (test_sta_flag(sta, WLAN_STA_PS_STA)) { |
754 | test_sta_flag(sta, WLAN_STA_PS_DRIVER)) { | ||
755 | BUG_ON(!sdata->bss); | 754 | BUG_ON(!sdata->bss); |
756 | 755 | ||
757 | clear_sta_flag(sta, WLAN_STA_PS_STA); | 756 | clear_sta_flag(sta, WLAN_STA_PS_STA); |
758 | clear_sta_flag(sta, WLAN_STA_PS_DRIVER); | ||
759 | 757 | ||
760 | atomic_dec(&sdata->bss->num_sta_ps); | 758 | atomic_dec(&sdata->bss->num_sta_ps); |
761 | sta_info_recalc_tim(sta); | 759 | sta_info_recalc_tim(sta); |