From: Franky Lin Date: Wed, 23 Nov 2011 01:21:46 +0000 (-0800) Subject: brcm80211: fmac: discard packet received when net device not registered X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c094c77ce9c338adc08d6d71b2d92a7761992b8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git brcm80211: fmac: discard packet received when net device not registered A new feature in the dongle firmware requires a handshake during firmware intialization. The request is sent in event packets which the host driver is not able to handle before any net device registered. Discard those packets as the context for handling it is missing. The initialization handler will be added as part of feature support code in the future. Signed-off-by: Franky Lin Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 7af14138c5db..62413e861784 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c @@ -431,6 +431,12 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, if (ifp == NULL) ifp = drvr_priv->iflist[0]; + if (!ifp || !ifp->ndev || + ifp->ndev->reg_state != NETREG_REGISTERED) { + brcmu_pkt_buf_free_skb(skb); + continue; + } + skb->dev = ifp->ndev; skb->protocol = eth_type_trans(skb, skb->dev);