cfg80211: check wdev->netdev in connection work
authorJohannes Berg <johannes.berg@intel.com>
Thu, 23 May 2013 16:10:21 +0000 (18:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 23:02:14 +0000 (16:02 -0700)
commit c815797663b72e3ac1736f1886538152bc48e4af upstream.

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.

Reported-by: YanBo <dreamfly281@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/sme.c

index f7e937f..3fd50a1 100644 (file)
@@ -222,6 +222,9 @@ void cfg80211_conn_work(struct work_struct *work)
        mutex_lock(&rdev->devlist_mtx);
 
        list_for_each_entry(wdev, &rdev->netdev_list, list) {
+               if (!wdev->netdev)
+                       continue;
+
                wdev_lock(wdev);
                if (!netif_running(wdev->netdev)) {
                        wdev_unlock(wdev);