Commit 243e6df4 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: fix SMPS debugfs locking

The locking with SMPS requests means that the
debugs file should lock the mgd mutex, not the
iflist mutex. Calls to __ieee80211_request_smps()
need to hold that mutex, so add an assertion.

This has always been wrong, but for some reason
never been noticed, probably because the locking
error only happens while unassociated.

Cc: stable@kernel.org [2.6.34+]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 10e99777
...@@ -1504,6 +1504,8 @@ int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata, ...@@ -1504,6 +1504,8 @@ int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata,
enum ieee80211_smps_mode old_req; enum ieee80211_smps_mode old_req;
int err; int err;
lockdep_assert_held(&sdata->u.mgd.mtx);
old_req = sdata->u.mgd.req_smps; old_req = sdata->u.mgd.req_smps;
sdata->u.mgd.req_smps = smps_mode; sdata->u.mgd.req_smps = smps_mode;
......
...@@ -177,9 +177,9 @@ static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata, ...@@ -177,9 +177,9 @@ static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata,
if (sdata->vif.type != NL80211_IFTYPE_STATION) if (sdata->vif.type != NL80211_IFTYPE_STATION)
return -EOPNOTSUPP; return -EOPNOTSUPP;
mutex_lock(&local->iflist_mtx); mutex_lock(&sdata->u.mgd.mtx);
err = __ieee80211_request_smps(sdata, smps_mode); err = __ieee80211_request_smps(sdata, smps_mode);
mutex_unlock(&local->iflist_mtx); mutex_unlock(&sdata->u.mgd.mtx);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment