From: Dmitry Shmidt Date: Wed, 5 Oct 2011 17:48:59 +0000 (-0700) Subject: net: wireless: bcmdhd: Fix event thread termination in case of empty queue X-Git-Tag: firefly_0821_release~7613^2~272 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0cd19f01a749ffa2b59345947300bc543cd9dd7c;p=firefly-linux-kernel-4.4.55.git net: wireless: bcmdhd: Fix event thread termination in case of empty queue Signed-off-by: Dmitry Shmidt --- diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index 1eaf512b6f2e..a576ca38db79 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -5735,22 +5735,18 @@ static s32 wl_event_handler(void *data) SMP_RD_BARRIER_DEPENDS(); if (tsk->terminated) break; - e = wl_deq_event(wl); - if (unlikely(!e)) { - WL_ERR(("equeue empty..\n")); - DHD_OS_WAKE_UNLOCK(wl->pub); - return 0; - } - WL_DBG(("event type (%d), if idx: %d\n", e->etype, e->emsg.ifidx)); - netdev = dhd_idx2net((struct dhd_pub *)(wl->pub), e->emsg.ifidx); - if (!netdev) - netdev = wl_to_prmry_ndev(wl); - if (e->etype < WLC_E_LAST && wl->evt_handler[e->etype]) { - wl->evt_handler[e->etype] (wl, netdev, &e->emsg, e->edata); - } else { - WL_DBG(("Unknown Event (%d): ignoring\n", e->etype)); + while ((e = wl_deq_event(wl))) { + WL_DBG(("event type (%d), if idx: %d\n", e->etype, e->emsg.ifidx)); + netdev = dhd_idx2net((struct dhd_pub *)(wl->pub), e->emsg.ifidx); + if (!netdev) + netdev = wl_to_prmry_ndev(wl); + if (e->etype < WLC_E_LAST && wl->evt_handler[e->etype]) { + wl->evt_handler[e->etype] (wl, netdev, &e->emsg, e->edata); + } else { + WL_DBG(("Unknown Event (%d): ignoring\n", e->etype)); + } + wl_put_event(e); } - wl_put_event(e); DHD_OS_WAKE_UNLOCK(wl->pub); } WL_DBG(("%s was terminated\n", __func__));