From: Stanislaw Gruszka Date: Wed, 28 Mar 2012 14:01:20 +0000 (+0200) Subject: mac80211: protect ->scanning by mutex in ieee80211_work_work() X-Git-Tag: upstream/snapshot3+hdmi~7403^2~410^2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f5460706e5feaef286aacce37647f7e57d026e4;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mac80211: protect ->scanning by mutex in ieee80211_work_work() Signed-off-by: Stanislaw Gruszka Signed-off-by: John W. Linville --- diff --git a/net/mac80211/work.c b/net/mac80211/work.c index 1f74af3..b2650a9 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c @@ -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) {