mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 00:06:36 +00:00
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: c462ebcdfe
('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>
This commit is contained in:
parent
394f0ed531
commit
81542fac6e
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue