net: wireless: bcmdhd: Fix crash in p2p OFF
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 20 Oct 2011 20:45:57 +0000 (13:45 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Thu, 20 Oct 2011 20:49:26 +0000 (13:49 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/wl_cfg80211.c

index 193625c8ccf67347966a97dd012184973287e1f1..5a96116501c7fa4d2ace73caffdd5e26bf9e3777 100644 (file)
@@ -1076,7 +1076,8 @@ _dhd_sysioc_thread(void *data)
                                in_ap = (ap_net_dev != NULL);
                                dhd_os_spin_unlock(&dhd->pub, flags);
 #endif /* SOFTAP */
-                               if (dhd->iflist[i]->state)
+
+                               if (dhd->iflist[i] && dhd->iflist[i]->state)
                                        dhd_op_if(dhd->iflist[i]);
 
                                if (dhd->iflist[i] == NULL) {
@@ -1084,6 +1085,7 @@ _dhd_sysioc_thread(void *data)
                                                "!\n\n", __FUNCTION__, i));
                                        continue;
                                }
+
 #ifdef SOFTAP
                                if (in_ap && dhd->set_macaddress)  {
                                        DHD_TRACE(("attempt to set MAC for %s in AP Mode,"
index d269172a7711e36f8a33aa2f0c2834497b5a4ed4..6a3003244261a7a2ae8026e33b3575817224c038 100644 (file)
@@ -1135,8 +1135,7 @@ wl_cfg80211_notify_ifdel(struct net_device *net)
 {
        struct wl_priv *wl = wlcfg_drv_priv;
 
-
-       if (wl->p2p->vif_created) {
+       if (wl->p2p && wl->p2p->vif_created) {
                s32 index = 0;
                WL_DBG(("IF_DEL event called from dongle, net %x, vif name: %s\n",
                        (unsigned int)net, wl->p2p->vir_ifname));