diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2014-01-29 01:56:21 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-02-04 15:58:11 -0500 |
commit | dbd72850dcc9738b42a9762ef8c4a1a66b30d897 (patch) | |
tree | 11a1f250e7af7bdeaa8f154762522b8a7db0deb8 /net/mac80211/cfg.c | |
parent | cc901de1bcb0372583466075bfa62e3049dc6288 (diff) |
mac80211: add missing CSA locking
The patch adds a missing sdata lock and adds a few
lockdeps for easier maintenance.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 27fa53bfed0d..875e63d3d9c5 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1053,6 +1053,7 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
1053 | int err; | 1053 | int err; |
1054 | 1054 | ||
1055 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1055 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1056 | sdata_assert_lock(sdata); | ||
1056 | 1057 | ||
1057 | /* don't allow changing the beacon while CSA is in place - offset | 1058 | /* don't allow changing the beacon while CSA is in place - offset |
1058 | * of channel switch counter may change | 1059 | * of channel switch counter may change |
@@ -1080,6 +1081,8 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) | |||
1080 | struct probe_resp *old_probe_resp; | 1081 | struct probe_resp *old_probe_resp; |
1081 | struct cfg80211_chan_def chandef; | 1082 | struct cfg80211_chan_def chandef; |
1082 | 1083 | ||
1084 | sdata_assert_lock(sdata); | ||
1085 | |||
1083 | old_beacon = sdata_dereference(sdata->u.ap.beacon, sdata); | 1086 | old_beacon = sdata_dereference(sdata->u.ap.beacon, sdata); |
1084 | if (!old_beacon) | 1087 | if (!old_beacon) |
1085 | return -ENOENT; | 1088 | return -ENOENT; |
@@ -3002,6 +3005,8 @@ static void ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata) | |||
3002 | struct ieee80211_local *local = sdata->local; | 3005 | struct ieee80211_local *local = sdata->local; |
3003 | int err, changed = 0; | 3006 | int err, changed = 0; |
3004 | 3007 | ||
3008 | sdata_assert_lock(sdata); | ||
3009 | |||
3005 | mutex_lock(&local->mtx); | 3010 | mutex_lock(&local->mtx); |
3006 | sdata->radar_required = sdata->csa_radar_required; | 3011 | sdata->radar_required = sdata->csa_radar_required; |
3007 | err = ieee80211_vif_change_channel(sdata, &changed); | 3012 | err = ieee80211_vif_change_channel(sdata, &changed); |
@@ -3083,7 +3088,7 @@ int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, | |||
3083 | struct ieee80211_if_mesh __maybe_unused *ifmsh; | 3088 | struct ieee80211_if_mesh __maybe_unused *ifmsh; |
3084 | int err, num_chanctx, changed = 0; | 3089 | int err, num_chanctx, changed = 0; |
3085 | 3090 | ||
3086 | lockdep_assert_held(&sdata->wdev.mtx); | 3091 | sdata_assert_lock(sdata); |
3087 | 3092 | ||
3088 | if (!list_empty(&local->roc_list) || local->scanning) | 3093 | if (!list_empty(&local->roc_list) || local->scanning) |
3089 | return -EBUSY; | 3094 | return -EBUSY; |