aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index f432bd3755b1..482c70e70127 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -85,6 +85,7 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
85 ASSERT_RTNL(); 85 ASSERT_RTNL();
86 ASSERT_RDEV_LOCK(rdev); 86 ASSERT_RDEV_LOCK(rdev);
87 ASSERT_WDEV_LOCK(wdev); 87 ASSERT_WDEV_LOCK(wdev);
88 lockdep_assert_held(&rdev->sched_scan_mtx);
88 89
89 if (rdev->scan_req) 90 if (rdev->scan_req)
90 return -EBUSY; 91 return -EBUSY;
@@ -223,6 +224,7 @@ void cfg80211_conn_work(struct work_struct *work)
223 rtnl_lock(); 224 rtnl_lock();
224 cfg80211_lock_rdev(rdev); 225 cfg80211_lock_rdev(rdev);
225 mutex_lock(&rdev->devlist_mtx); 226 mutex_lock(&rdev->devlist_mtx);
227 mutex_lock(&rdev->sched_scan_mtx);
226 228
227 list_for_each_entry(wdev, &rdev->wdev_list, list) { 229 list_for_each_entry(wdev, &rdev->wdev_list, list) {
228 wdev_lock(wdev); 230 wdev_lock(wdev);
@@ -247,6 +249,7 @@ void cfg80211_conn_work(struct work_struct *work)
247 wdev_unlock(wdev); 249 wdev_unlock(wdev);
248 } 250 }
249 251
252 mutex_unlock(&rdev->sched_scan_mtx);
250 mutex_unlock(&rdev->devlist_mtx); 253 mutex_unlock(&rdev->devlist_mtx);
251 cfg80211_unlock_rdev(rdev); 254 cfg80211_unlock_rdev(rdev);
252 rtnl_unlock(); 255 rtnl_unlock();
@@ -320,11 +323,9 @@ void cfg80211_sme_scan_done(struct net_device *dev)
320{ 323{
321 struct wireless_dev *wdev = dev->ieee80211_ptr; 324 struct wireless_dev *wdev = dev->ieee80211_ptr;
322 325
323 mutex_lock(&wiphy_to_dev(wdev->wiphy)->devlist_mtx);
324 wdev_lock(wdev); 326 wdev_lock(wdev);
325 __cfg80211_sme_scan_done(dev); 327 __cfg80211_sme_scan_done(dev);
326 wdev_unlock(wdev); 328 wdev_unlock(wdev);
327 mutex_unlock(&wiphy_to_dev(wdev->wiphy)->devlist_mtx);
328} 329}
329 330
330void cfg80211_sme_rx_auth(struct net_device *dev, 331void cfg80211_sme_rx_auth(struct net_device *dev,
@@ -924,9 +925,12 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev,
924 int err; 925 int err;
925 926
926 mutex_lock(&rdev->devlist_mtx); 927 mutex_lock(&rdev->devlist_mtx);
928 /* might request scan - scan_mtx -> wdev_mtx dependency */
929 mutex_lock(&rdev->sched_scan_mtx);
927 wdev_lock(dev->ieee80211_ptr); 930 wdev_lock(dev->ieee80211_ptr);
928 err = __cfg80211_connect(rdev, dev, connect, connkeys, NULL); 931 err = __cfg80211_connect(rdev, dev, connect, connkeys, NULL);
929 wdev_unlock(dev->ieee80211_ptr); 932 wdev_unlock(dev->ieee80211_ptr);
933 mutex_unlock(&rdev->sched_scan_mtx);
930 mutex_unlock(&rdev->devlist_mtx); 934 mutex_unlock(&rdev->devlist_mtx);
931 935
932 return err; 936 return err;