diff options
author | Zhang Changzhong <zhangchangzhong@huawei.com> | 2022-11-17 12:33:01 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-12-22 17:07:22 +0100 |
commit | 212fde3fe76e962598ce1d47b97cc78afdfc71b3 (patch) | |
tree | 26dc4da1bac8707ed58168c800b0f291a7496e01 | |
parent | wifi: brcmfmac: Fix potential stack-out-of-bounds in brcmf_c_preinit_dcmds() (diff) | |
download | linux-212fde3fe76e962598ce1d47b97cc78afdfc71b3.tar.xz linux-212fde3fe76e962598ce1d47b97cc78afdfc71b3.zip |
wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
The brcmf_netdev_start_xmit() returns NETDEV_TX_OK without freeing skb
in case of pskb_expand_head() fails, add dev_kfree_skb() to fix it.
Compile tested only.
Fixes: 270a6c1f65fe ("brcmfmac: rework headroom check in .start_xmit()")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1668684782-47422-1-git-send-email-zhangchangzhong@huawei.com
-rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 83ea251cfcec..f599d5f896e8 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -336,6 +336,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, bphy_err(drvr, "%s: failed to expand headroom\n", brcmf_ifname(ifp)); atomic_inc(&drvr->bus_if->stats.pktcow_failed); + dev_kfree_skb(skb); goto done; } } |