X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=package%2Fkernel%2Fmac80211%2Fpatches%2F351-0001-brcmfmac-testing-the-wrong-variable-in-brcmf_rx_hdrp.patch;fp=package%2Fkernel%2Fmac80211%2Fpatches%2F351-0001-brcmfmac-testing-the-wrong-variable-in-brcmf_rx_hdrp.patch;h=11c65a49ed68fa0b74a3c67a9fa58d061fbf638f;hp=0000000000000000000000000000000000000000;hb=b3ff29aed36fc4e2a39ead966f37203a467e1873;hpb=b0684dafa3c9a4692bd965d1f2ed65c2c08bc6a1 diff --git a/package/kernel/mac80211/patches/351-0001-brcmfmac-testing-the-wrong-variable-in-brcmf_rx_hdrp.patch b/package/kernel/mac80211/patches/351-0001-brcmfmac-testing-the-wrong-variable-in-brcmf_rx_hdrp.patch new file mode 100644 index 0000000000..11c65a49ed --- /dev/null +++ b/package/kernel/mac80211/patches/351-0001-brcmfmac-testing-the-wrong-variable-in-brcmf_rx_hdrp.patch @@ -0,0 +1,39 @@ +From: Dan Carpenter +Date: Tue, 19 Apr 2016 07:25:43 -0700 +Subject: [PATCH] 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 +--- + +--- 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 + 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;