Commit 1601b1e5 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 02f5ba5b
...@@ -400,19 +400,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, ...@@ -400,19 +400,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
else else
__set_bit(SCAN_SW_SCANNING, &local->scanning); __set_bit(SCAN_SW_SCANNING, &local->scanning);
/*
* Kicking off the scan need not be protected,
* only the scan variable stuff, since now
* local->scan_req is assigned and other callers
* will abort their scan attempts.
*
* This avoids too many locking dependencies
* so that the scan completed calls have more
* locking freedom.
*/
ieee80211_recalc_idle(local); ieee80211_recalc_idle(local);
mutex_unlock(&local->scan_mtx);
if (local->ops->hw_scan) { if (local->ops->hw_scan) {
WARN_ON(!ieee80211_prep_hw_scan(local)); WARN_ON(!ieee80211_prep_hw_scan(local));
...@@ -420,8 +408,6 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, ...@@ -420,8 +408,6 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
} else } else
rc = ieee80211_start_sw_scan(local); rc = ieee80211_start_sw_scan(local);
mutex_lock(&local->scan_mtx);
if (rc) { if (rc) {
kfree(local->hw_scan_req); kfree(local->hw_scan_req);
local->hw_scan_req = NULL; local->hw_scan_req = NULL;
......
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