diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-12-03 10:58:55 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-12-18 19:58:11 +0100 |
commit | 216b44000ada87a63891a8214c347e05a4aea8fe (patch) | |
tree | 11eb869af3a0b0cf6ba76d7ca363a73ca0cfef37 /drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | |
parent | rsi: add missing endpoint sanity checks (diff) | |
download | linux-216b44000ada87a63891a8214c347e05a4aea8fe.tar.xz linux-216b44000ada87a63891a8214c347e05a4aea8fe.zip |
brcmfmac: Fix use after free in brcmf_sdio_readframes()
The brcmu_pkt_buf_free_skb() function frees "pkt" so it leads to a
static checker warning:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:1974 brcmf_sdio_readframes()
error: dereferencing freed memory 'pkt'
It looks like there was supposed to be a continue after we free "pkt".
Fixes: 4754fceeb9a6 ("brcmfmac: streamline SDIO read frame routine")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c')
-rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 264ad63232f8..1dea0178832e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -1935,6 +1935,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) BRCMF_SDIO_FT_NORMAL)) { rd->len = 0; brcmu_pkt_buf_free_skb(pkt); + continue; } bus->sdcnt.rx_readahead_cnt++; if (rd->len != roundup(rd_new.len, 16)) { |