Patch "ethernet: aeroflex: fix potential skb leak in greth_init_rings()" has been added to the 5.15-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

    ethernet: aeroflex: fix potential skb leak in greth_init_rings()

to the 5.15-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:
     ethernet-aeroflex-fix-potential-skb-leak-in-greth_in.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 34be629d35b7e1341994d771a1b4aece990d01ac
Author: Zhang Changzhong <zhangchangzhong@xxxxxxxxxx>
Date:   Sun Dec 4 14:09:08 2022 +0800

    ethernet: aeroflex: fix potential skb leak in greth_init_rings()
    
    [ Upstream commit 063a932b64db3317ec020c94466fe52923a15f60 ]
    
    The greth_init_rings() function won't free the newly allocated skb when
    dma_mapping_error() returns error, so add dev_kfree_skb() to fix it.
    
    Compile tested only.
    
    Fixes: d4c41139df6e ("net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver")
    Signed-off-by: Zhang Changzhong <zhangchangzhong@xxxxxxxxxx>
    Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/1670134149-29516-1-git-send-email-zhangchangzhong@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index c560ad06f0be..a95bac4e14f6 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -258,6 +258,7 @@ static int greth_init_rings(struct greth_private *greth)
 			if (dma_mapping_error(greth->dev, dma_addr)) {
 				if (netif_msg_ifup(greth))
 					dev_err(greth->dev, "Could not create initial DMA mapping\n");
+				dev_kfree_skb(skb);
 				goto cleanup;
 			}
 			greth->rx_skbuff[i] = skb;



[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