Patch "net: systemport: fix potential memory leak in bcm_sysport_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: systemport: fix potential memory leak in bcm_sysport_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-systemport-fix-potential-memory-leak-in-bcm_sysp.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 64309ae523059beb1d2628ea1bc7c04530fea2a6
Author: Wang Hai <wanghai38@xxxxxxxxxx>
Date:   Mon Oct 14 22:51:15 2024 +0800

    net: systemport: fix potential memory leak in bcm_sysport_xmit()
    
    [ Upstream commit c401ed1c709948e57945485088413e1bb5e94bd1 ]
    
    The bcm_sysport_xmit() returns NETDEV_TX_OK without freeing skb
    in case of dma_map_single() fails, add dev_kfree_skb() to fix it.
    
    Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
    Signed-off-by: Wang Hai <wanghai38@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241014145115.44977-1-wanghai38@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index bf1611cce974a..49e890a7e04a3 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1359,6 +1359,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
 		netif_err(priv, tx_err, dev, "DMA map failed at %p (len=%d)\n",
 			  skb->data, skb_len);
 		ret = NETDEV_TX_OK;
+		dev_kfree_skb_any(skb);
 		goto out;
 	}
 




[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