Patch "wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-brcmfmac-fix-potential-memory-leak-in-brcmf_net.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit bfe5565e41f0d335303f46eb180de18d449f6db2
Author: Zhang Changzhong <zhangchangzhong@xxxxxxxxxx>
Date:   Thu Nov 17 19:33:01 2022 +0800

    wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
    
    [ Upstream commit 212fde3fe76e962598ce1d47b97cc78afdfc71b3 ]
    
    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@xxxxxxxxxx>
    Reviewed-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/1668684782-47422-1-git-send-email-zhangchangzhong@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index c8e1d505f7b5d..3d544eedc1a39 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -333,6 +333,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;
 		}
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux