]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: thunderbolt: fix memory leak in tbnet_open()
authorZhengchao Shao <shaozhengchao@huawei.com>
Wed, 7 Dec 2022 01:50:01 +0000 (09:50 +0800)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:02:57 +0000 (14:02 +0100)
commit51830060c168f6ac9b5f09c9ab694991df5e6832
tree66719c2c7cfd8365c1be70d97c163f2ecad0bfd2
parent006d53b2353f53e898e8e66c1506f93a796c9d1f
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@huawei.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20221207015001.1755826-1-shaozhengchao@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit b9274dbe399952a8175db2e1ee148b7c9ba2b538)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/net/thunderbolt.c