Commit 6d3560d4 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: fix scan abort sanity checks

Since sometimes mac80211 queues up a scan request
to only act on it later, it must be allowed to
(internally) cancel a not-yet-running scan, e.g.
when the interface is taken down. This condition
was missing since we always checked only the
local->scanning variable which isn't yet set in
that situation.
Reported-by: default avatarLuis R. Rodriguez <mcgrof@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1933ac4d
...@@ -288,10 +288,14 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) ...@@ -288,10 +288,14 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
mutex_lock(&local->scan_mtx); mutex_lock(&local->scan_mtx);
if (WARN_ON(!local->scanning)) { /*
mutex_unlock(&local->scan_mtx); * It's ok to abort a not-yet-running scan (that
return; * we have one at all will be verified by checking
} * local->scan_req next), but not to complete it
* successfully.
*/
if (WARN_ON(!local->scanning && !aborted))
aborted = true;
if (WARN_ON(!local->scan_req)) { if (WARN_ON(!local->scan_req)) {
mutex_unlock(&local->scan_mtx); mutex_unlock(&local->scan_mtx);
......
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