]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mac80211: complete scan work immediately if quiesced or suspended
authorLuciano Coelho <luciano.coelho@intel.com>
Thu, 22 Jan 2015 21:34:10 +0000 (23:34 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 23 Jan 2015 09:54:22 +0000 (10:54 +0100)
It is possible that a deferred scan is queued after the queues are
flushed in __ieee80211_suspend().  The deferred scan work may be
scheduled by ROC or ieee80211_stop_poll().

To make sure don't start a new scan while suspending, check whether
we're quiescing or suspended and complete the scan immediately if
that's the case.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/scan.c

index 7807fa42ed3f4fcd8fc6b066cbf89cd987e1e331..05f0d711b6d8666701e91262141fb67711d9dad7 100644 (file)
@@ -828,6 +828,11 @@ void ieee80211_scan_work(struct work_struct *work)
 
        mutex_lock(&local->mtx);
 
+       if (!ieee80211_can_run_worker(local)) {
+               aborted = true;
+               goto out_complete;
+       }
+
        sdata = rcu_dereference_protected(local->scan_sdata,
                                          lockdep_is_held(&local->mtx));
        scan_req = rcu_dereference_protected(local->scan_req,