From 108376f4f45f772db0addd3ee6f601161c1d3a59 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Thu, 20 Oct 2011 13:45:57 -0700 Subject: [PATCH] net: wireless: bcmdhd: Fix crash in p2p OFF Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/bcmdhd/dhd_linux.c | 4 +++- drivers/net/wireless/bcmdhd/wl_cfg80211.c | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) 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)); -- 2.34.1