diff options
| author | Tom Rix <[email protected]> | 2020-08-02 09:18:04 -0700 |
|---|---|---|
| committer | Kalle Valo <[email protected]> | 2020-08-18 15:49:28 +0300 |
| commit | 9c9f015bc9f8839831c7ba0a6d731a3853c464e2 (patch) | |
| tree | 9b6da830694c6fc91395d497c9f07c3310c2c5db /tools/perf/scripts/python/bin | |
| parent | 838933ca5b9cb5af7f17c41524d927b7a580b0e0 (diff) | |
brcmfmac: check ndev pointer
Clang static analysis reports this error
brcmfmac/core.c:490:4: warning: Dereference of null pointer
(*ifp)->ndev->stats.rx_errors++;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this block of code
if (ret || !(*ifp) || !(*ifp)->ndev) {
if (ret != -ENODATA && *ifp)
(*ifp)->ndev->stats.rx_errors++;
brcmu_pkt_buf_free_skb(skb);
return -ENODATA;
}
(*ifp)->ndev being NULL is caught as an error
But then it is used to report the error.
So add a check before using it.
Fixes: 91b632803ee4 ("brcmfmac: Use net_device_stats from struct net_device")
Signed-off-by: Tom Rix <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions