Patch "net: thunderbolt: fix memory leak in tbnet_open()" 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

    net: thunderbolt: fix memory leak in tbnet_open()

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:
     net-thunderbolt-fix-memory-leak-in-tbnet_open.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 8728d2c940c67b1e4cef5f8e095e4d8c242cb25a
Author: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
Date:   Wed Dec 7 09:50:01 2022 +0800

    net: thunderbolt: fix memory leak in tbnet_open()
    
    [ Upstream commit ed14e5903638f6eb868e3e2b4e610985e6a6c876 ]
    
    When tb_ring_alloc_rx() failed in tbnet_open(), ida that allocated in
    tb_xdomain_alloc_out_hopid() is not released. Add
    tb_xdomain_release_out_hopid() to the error path to release ida.
    
    Fixes: 180b0689425c ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection")
    Signed-off-by: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
    Acked-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
    Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221207015001.1755826-1-shaozhengchao@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c
index 129149640225..3395dcb0b262 100644
--- a/drivers/net/thunderbolt.c
+++ b/drivers/net/thunderbolt.c
@@ -902,6 +902,7 @@ static int tbnet_open(struct net_device *dev)
 				tbnet_start_poll, net);
 	if (!ring) {
 		netdev_err(dev, "failed to allocate Rx ring\n");
+		tb_xdomain_release_out_hopid(xd, hopid);
 		tb_ring_free(net->tx_ring.ring);
 		net->tx_ring.ring = NULL;
 		return -ENOMEM;



[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