linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mac80211: Fix incorrect num_sta_ps decrement in __sta_info_destroy
@ 2012-01-27 10:02 Helmut Schaa
  2012-01-27 10:02 ` [PATCH 2/3] mac80211: Fix incorrect num_sta_ps decrement in ap_sta_ps_end Helmut Schaa
  0 siblings, 1 reply; 5+ messages in thread
From: Helmut Schaa @ 2012-01-27 10:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, johannes, Helmut Schaa

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>
---
 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 5b4ab21..70a0de3 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -750,12 +750,10 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
 
 	sta->dead = true;
 
-	if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
-	    test_sta_flag(sta, WLAN_STA_PS_DRIVER)) {
+	if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
 		BUG_ON(!sdata->bss);
 
 		clear_sta_flag(sta, WLAN_STA_PS_STA);
-		clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
 
 		atomic_dec(&sdata->bss->num_sta_ps);
 		sta_info_recalc_tim(sta);
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-30 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-27 10:02 [PATCH 1/3] mac80211: Fix incorrect num_sta_ps decrement in __sta_info_destroy Helmut Schaa
2012-01-27 10:02 ` [PATCH 2/3] mac80211: Fix incorrect num_sta_ps decrement in ap_sta_ps_end Helmut Schaa
2012-01-27 10:02   ` [PATCH 3/3] mac80211: Move num_sta_ps counter decrement after synchronize_rcu Helmut Schaa
2012-01-30 11:07   ` [PATCH 2/3] mac80211: Fix incorrect num_sta_ps decrement in ap_sta_ps_end Helmut Schaa
2012-01-30 14:18   ` [PATCHv2 " Helmut Schaa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).