Skip to content

Commit

Permalink
mac80211: Fix possible race between sta_unblock and network softirq
Browse files Browse the repository at this point in the history
All other code paths in sta_unblock synchronize with the network
softirq by using local_bh_disable/enable. Do the same around
ieee80211_sta_ps_deliver_wakeup.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Helmut Schaa authored and John W. Linville committed Jan 17, 2012
1 parent d981e05 commit 5442047
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,11 @@ static void sta_unblock(struct work_struct *wk)
if (sta->dead)
return;

if (!test_sta_flag(sta, WLAN_STA_PS_STA))
if (!test_sta_flag(sta, WLAN_STA_PS_STA)) {
local_bh_disable();
ieee80211_sta_ps_deliver_wakeup(sta);
else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) {
local_bh_enable();
} else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) {
clear_sta_flag(sta, WLAN_STA_PS_DRIVER);

local_bh_disable();
Expand Down

0 comments on commit 5442047

Please sign in to comment.