Skip to content

Commit

Permalink
mac80211: fix sdata locking around __ieee80211_request_smps
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg committed Jun 3, 2013
1 parent a8cd57b commit ed405be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ed405be

Please sign in to comment.