FAILED: patch "[PATCH] net: thunderbolt: Release the Rx HopID that was handed out on" failed to apply to 5.15-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 2f1463554d0561a2fead81e3888604e5c1125e29
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090349-egomaniac-herald-cc74@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2f1463554d0561a2fead81e3888604e5c1125e29 Mon Sep 17 00:00:00 2001
From: Fan Ye <[email protected]>
Date: Tue, 11 Aug 2026 13:20:49 +0000
Subject: [PATCH] net: thunderbolt: Release the Rx HopID that was handed out on
mismatch
tb_xdomain_alloc_in_hopid() passes the wanted HopID to ida_alloc_range() as the lower bound, so a taken id is not an error there: the allocator returns the next free one above it. tbnet_connected_work() asks for the peer's transmit path, treats any other id as a failure and returns without releasing what it got, so that allocation stays live for the rest of the XDomain connection with nothing left holding a reference to it.
Release the id when it is not the one we asked for, the same way the error unwind at the end of the function releases the expected one.
drivers/net/thunderbolt/main.c +2 -0
@@ -647,6 +647,8 @@ static void tbnet_connected_work(struct work_struct *work) ret =tb_xdomain_alloc_in_hopid (net->xd, net->remote_transmit_path);if (ret != net->remote_transmit_path) {netdev_err (net->dev,"failed to allocate Rx HopID\n" ); +if (ret >=0 ) +tb_xdomain_release_in_hopid (net->xd, ret);return ; }
Sasha Levin
maintainerPATCH 1/1 net: thunderbolt: Release the Rx HopID that was handed out on mismatch
From: Fan Ye <[email protected]>
[ Upstream commit 2f1463554d0561a2fead81e3888604e5c1125e29 ]
tb_xdomain_alloc_in_hopid() passes the wanted HopID to ida_alloc_range() as the lower bound, so a taken id is not an error there: the allocator returns the next free one above it. tbnet_connected_work() asks for the peer's transmit path, treats any other id as a failure and returns without releasing what it got, so that allocation stays live for the rest of the XDomain connection with nothing left holding a reference to it.
Release the id when it is not the one we asked for, the same way the error unwind at the end of the function releases the expected one.
--- drivers/net/thunderbolt.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/thunderbolt.c +2 -0
@@ -619,6 +619,8 @@ static void tbnet_connected_work(struct work_struct *work) ret =tb_xdomain_alloc_in_hopid (net->xd, net->remote_transmit_path);if (ret != net->remote_transmit_path) {netdev_err (net->dev,"failed to allocate Rx HopID\n" ); +if (ret >=0 ) +tb_xdomain_release_in_hopid (net->xd, ret);return ; }
Signature · 1 line
2.53.0