mac80211: protect ->scanning by mutex in ieee80211_work_work()
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 28 Mar 2012 14:01:20 +0000 (16:01 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Apr 2012 18:31:50 +0000 (14:31 -0400)
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/work.c

index 1f74af33901bd3829773d3c1663e71d704508112..b2650a9d45ff765c7555628f82dea3c673a76380 100644 (file)
@@ -122,9 +122,6 @@ static void ieee80211_work_work(struct work_struct *work)
        enum work_action rma;
        bool remain_off_channel = false;
 
-       if (local->scanning)
-               return;
-
        /*
         * ieee80211_queue_work() should have picked up most cases,
         * here we'll pick the rest.
@@ -134,6 +131,11 @@ static void ieee80211_work_work(struct work_struct *work)
 
        mutex_lock(&local->mtx);
 
+       if (local->scanning) {
+               mutex_unlock(&local->mtx);
+               return;
+       }
+
        ieee80211_recalc_idle(local);
 
        list_for_each_entry_safe(wk, tmp, &local->work_list, list) {