aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-10-07 06:55:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-07 14:41:27 -0400
commit7b99a7c2dab7efe7c265b66fedbf3444958ebfe3 (patch)
treed45093d306d686d4cb0cdc391c6895f372b20495
parent4b34d432b0fcff422304de4eb49d6da861fe335c (diff)
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 <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/scan.c3
1 files changed, 1 insertions, 2 deletions
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)
681 goto out_complete; 681 goto out_complete;
682 } 682 }
683 683
684 mutex_unlock(&local->mtx);
685
686 /* 684 /*
687 * as long as no delay is required advance immediately 685 * as long as no delay is required advance immediately
688 * without scheduling a new work 686 * without scheduling a new work
@@ -713,6 +711,7 @@ void ieee80211_scan_work(struct work_struct *work)
713 } while (next_delay == 0); 711 } while (next_delay == 0);
714 712
715 ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay); 713 ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay);
714 mutex_unlock(&local->mtx);
716 return; 715 return;
717 716
718out_complete: 717out_complete: