From: Dmitry Shmidt Date: Thu, 20 Oct 2011 20:45:57 +0000 (-0700) Subject: net: wireless: bcmdhd: Fix crash in p2p OFF X-Git-Tag: firefly_0821_release~7613^2~258 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=108376f4f45f772db0addd3ee6f601161c1d3a59;p=firefly-linux-kernel-4.4.55.git net: wireless: bcmdhd: Fix crash in p2p OFF Signed-off-by: Dmitry Shmidt --- diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c index 193625c8ccf6..5a96116501c7 100644 --- a/drivers/net/wireless/bcmdhd/dhd_linux.c +++ b/drivers/net/wireless/bcmdhd/dhd_linux.c @@ -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," diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index d269172a7711..6a3003244261 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -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));