summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-06-03 13:51:59 +0200
committerJohannes Berg <johannes.berg@intel.com>2013-06-03 13:51:59 +0200
commited405be5cb5e8e494e8dcd83b6eb1add34dc752a (patch)
tree97e167b6dd4cc16aa31adcbba575c381013574c3 /net/mac80211
parenta8cd57b3042446250f19daf98d120802dffc768d (diff)
downloadop-kernel-dev-ed405be5cb5e8e494e8dcd83b6eb1add34dc752a.zip
op-kernel-dev-ed405be5cb5e8e494e8dcd83b6eb1add34dc752a.tar.gz
mac80211: fix sdata locking around __ieee80211_request_smps
My cfg80211/mac80211 locking unification broke the sdata locking in ieee80211_set_power_mgmt, it needs to acquire the lock for __ieee80211_request_smps(). Add the locking. Reported-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9034da1..3062210 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2378,7 +2378,9 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
local->dynamic_ps_forced_timeout = timeout;
/* no change, but if automatic follow powersave */
+ sdata_lock(sdata);
__ieee80211_request_smps(sdata, sdata->u.mgd.req_smps);
+ sdata_unlock(sdata);
if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
OpenPOWER on IntegriCloud