cfg80211: check wdev->netdev in connection work
authorJohannes Berg <johannes.berg@intel.com>
Thu, 23 May 2013 16:10:21 +0000 (18:10 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 23 May 2013 16:12:38 +0000 (18:12 +0200)
If a P2P-Device is present and another virtual interface triggers
the connection work, the system crash because it tries to check
if the P2P-Device's netdev (which doesn't exist) is up. Skip any
wdevs that have no netdev to fix this.

Cc: stable@vger.kernel.org
Reported-by: YanBo <dreamfly281@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/sme.c

index 8b5eddfba1e5dfed07b1fb528204c125db2d7331..3ed35c345caed81966eb0ad52b7e1a4b350ec473 100644 (file)
@@ -231,6 +231,9 @@ void cfg80211_conn_work(struct work_struct *work)
        mutex_lock(&rdev->sched_scan_mtx);
 
        list_for_each_entry(wdev, &rdev->wdev_list, list) {
+               if (!wdev->netdev)
+                       continue;
+
                wdev_lock(wdev);
                if (!netif_running(wdev->netdev)) {
                        wdev_unlock(wdev);