Patch "net: bcmasp: fix potential memory leak in bcmasp_xmit()" has been added to the 6.6-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

    net: bcmasp: fix potential memory leak in bcmasp_xmit()

to the 6.6-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:
     net-bcmasp-fix-potential-memory-leak-in-bcmasp_xmit.patch
and it can be found in the queue-6.6 subdirectory.

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



commit a8bfc25654afd7c56607493aa1b025a3e0555730
Author: Wang Hai <wanghai38@xxxxxxxxxx>
Date:   Mon Oct 14 22:59:01 2024 +0800

    net: bcmasp: fix potential memory leak in bcmasp_xmit()
    
    [ Upstream commit fed07d3eb8a8d9fcc0e455175a89bc6445d6faed ]
    
    The bcmasp_xmit() returns NETDEV_TX_OK without freeing skb
    in case of mapping fails, add dev_kfree_skb() to fix it.
    
    Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
    Signed-off-by: Wang Hai <wanghai38@xxxxxxxxxx>
    Acked-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
    Link: https://patch.msgid.link/20241014145901.48940-1-wanghai38@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
index 6bf149d645941..f0647286c68b2 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
@@ -322,6 +322,7 @@ static netdev_tx_t bcmasp_xmit(struct sk_buff *skb, struct net_device *dev)
 			}
 			/* Rewind so we do not have a hole */
 			spb_index = intf->tx_spb_index;
+			dev_kfree_skb(skb);
 			return NETDEV_TX_OK;
 		}
 




[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