brcmfmac: testing the wrong variable in brcmf_rx_hdrpull()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 19 Apr 2016 14:25:43 +0000 (07:25 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 26 Apr 2016 09:29:43 +0000 (12:29 +0300)
commit81542fac6eae586e0d6fd502618342e8e20b4c5a
tree5d984fa3b06a7e251c475f0b2e800744ba6dbb5a
parent394f0ed53108d5e038910e3eb733ccd3f0d9c464
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 <dan.carpenter@oracle.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c