diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-10-31 02:44:08 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-02 15:39:49 -0500 |
commit | 6d3560d4fc9c5b9fe1a07a63926ea70512c69c32 (patch) | |
tree | 081b2d43707eb2f55414041fd088a6a60f38e2fc /net | |
parent | 1933ac4d9377ed44caba45abe1531ec1bc14bb63 (diff) |
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: Luis R. Rodriguez <mcgrof@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/scan.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index c46ac01e2a8f..88a9a1be314a 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -288,10 +288,14 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) | |||
288 | 288 | ||
289 | mutex_lock(&local->scan_mtx); | 289 | mutex_lock(&local->scan_mtx); |
290 | 290 | ||
291 | if (WARN_ON(!local->scanning)) { | 291 | /* |
292 | mutex_unlock(&local->scan_mtx); | 292 | * It's ok to abort a not-yet-running scan (that |
293 | return; | 293 | * we have one at all will be verified by checking |
294 | } | 294 | * local->scan_req next), but not to complete it |
295 | * successfully. | ||
296 | */ | ||
297 | if (WARN_ON(!local->scanning && !aborted)) | ||
298 | aborted = true; | ||
295 | 299 | ||
296 | if (WARN_ON(!local->scan_req)) { | 300 | if (WARN_ON(!local->scan_req)) { |
297 | mutex_unlock(&local->scan_mtx); | 301 | mutex_unlock(&local->scan_mtx); |