cfg80211: add missing device list locking
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 9 Aug 2009 09:51:29 +0000 (11:51 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 14 Aug 2009 13:13:54 +0000 (09:13 -0400)
When calling into the wext code from the NETDEV_UP
notifier, we need to hold the devlist_mtx mutex as
the wext code ends up calling into channel checks.

Reported-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/core.c

index 62e1ac0..e630648 100644 (file)
@@ -710,6 +710,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
        case NETDEV_UP:
 #ifdef CONFIG_WIRELESS_EXT
                cfg80211_lock_rdev(rdev);
+               mutex_lock(&rdev->devlist_mtx);
                wdev_lock(wdev);
                switch (wdev->iftype) {
                case NL80211_IFTYPE_ADHOC:
@@ -722,6 +723,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
                        break;
                }
                wdev_unlock(wdev);
+               mutex_unlock(&rdev->devlist_mtx);
                cfg80211_unlock_rdev(rdev);
 #endif
                break;