|
@@ -288,10 +288,14 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
|
|
|
|
|
|
mutex_lock(&local->scan_mtx);
|
|
|
|
|
|
- if (WARN_ON(!local->scanning)) {
|
|
|
- mutex_unlock(&local->scan_mtx);
|
|
|
- return;
|
|
|
- }
|
|
|
+ /*
|
|
|
+ * It's ok to abort a not-yet-running scan (that
|
|
|
+ * 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)) {
|
|
|
mutex_unlock(&local->scan_mtx);
|