From: Johannes Berg Date: Thu, 7 Oct 2010 10:55:24 +0000 (+0200) Subject: mac80211: fix sw scan locking X-Git-Tag: MMI-PSA29.97-13-9~21994^2~78^2^2~107 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7b99a7c2dab7efe7c265b66fedbf3444958ebfe3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mac80211: fix sw scan locking The recent scan overhaul broke locking because now we can jump to code that attempts to unlock, while we don't have the mutex held. Fix this by holding the mutex around all the relevant code. Reported-by: Ben Greear Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 523db930dabb..fb274db77e3c 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -681,8 +681,6 @@ void ieee80211_scan_work(struct work_struct *work) goto out_complete; } - mutex_unlock(&local->mtx); - /* * as long as no delay is required advance immediately * without scheduling a new work @@ -713,6 +711,7 @@ void ieee80211_scan_work(struct work_struct *work) } while (next_delay == 0); ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay); + mutex_unlock(&local->mtx); return; out_complete: