aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-07-30 07:30:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-04 15:27:36 -0400
commit1601b1e56e1093d6deb8f475fafc30cc30143357 (patch)
tree523921224fe15ad2abc647edb830c438c688644e /net
parent02f5ba5bac8b374bc2126920c7204c63019f28ce (diff)
mac80211: fix scan locking wrt. hw scan
Releasing the scan mutex while starting scans can lead to unexpected things happening, so we shouldn't do that. Fix that and hold the mutex across the scan triggering. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/scan.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 41f20fb7e670..872d7b6ef6b3 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -400,19 +400,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
400 else 400 else
401 __set_bit(SCAN_SW_SCANNING, &local->scanning); 401 __set_bit(SCAN_SW_SCANNING, &local->scanning);
402 402
403 /*
404 * Kicking off the scan need not be protected,
405 * only the scan variable stuff, since now
406 * local->scan_req is assigned and other callers
407 * will abort their scan attempts.
408 *
409 * This avoids too many locking dependencies
410 * so that the scan completed calls have more
411 * locking freedom.
412 */
413
414 ieee80211_recalc_idle(local); 403 ieee80211_recalc_idle(local);
415 mutex_unlock(&local->scan_mtx);
416 404
417 if (local->ops->hw_scan) { 405 if (local->ops->hw_scan) {
418 WARN_ON(!ieee80211_prep_hw_scan(local)); 406 WARN_ON(!ieee80211_prep_hw_scan(local));
@@ -420,8 +408,6 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
420 } else 408 } else
421 rc = ieee80211_start_sw_scan(local); 409 rc = ieee80211_start_sw_scan(local);
422 410
423 mutex_lock(&local->scan_mtx);
424
425 if (rc) { 411 if (rc) {
426 kfree(local->hw_scan_req); 412 kfree(local->hw_scan_req);
427 local->hw_scan_req = NULL; 413 local->hw_scan_req = NULL;