From: Dan Carpenter Date: Tue, 19 Apr 2016 14:25:43 +0000 (-0700) Subject: brcmfmac: testing the wrong variable in brcmf_rx_hdrpull() X-Git-Tag: v4.13~3064^2~146^2~11 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=81542fac6eae586e0d6fd502618342e8e20b4c5a;p=mirror_ubuntu-bionic-kernel.git brcmfmac: testing the wrong variable in brcmf_rx_hdrpull() Smatch complains about this code: drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c:335 brcmf_rx_hdrpull() error: we previously assumed '*ifp' could be null (see line 333) The problem is that we recently changed these from "ifp" to "*ifp" but there was one that we didn't update. - if (ret || !ifp || !ifp->ndev) { + if (ret || !(*ifp) || !(*ifp)->ndev) { if (ret != -ENODATA && ifp) ^^^ - ifp->stats.rx_errors++; + (*ifp)->stats.rx_errors++; I have updated it to *ifp as well. We always call this function is a non-NULL "ifp" pointer, btw. Fixes: c462ebcdfe42 ('brcmfmac: create common function for handling brcmf_proto_hdrpull()') Signed-off-by: Dan Carpenter Acked-by: Arend van Spriel Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 1b476d1fec2c..b590499f6883 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -331,7 +331,7 @@ static int brcmf_rx_hdrpull(struct brcmf_pub *drvr, struct sk_buff *skb, ret = brcmf_proto_hdrpull(drvr, true, skb, ifp); if (ret || !(*ifp) || !(*ifp)->ndev) { - if (ret != -ENODATA && ifp) + if (ret != -ENODATA && *ifp) (*ifp)->stats.rx_errors++; brcmu_pkt_buf_free_skb(skb); return -ENODATA;