From: WenTao Liang <vulab@iscas.ac.cn>
To: andreas.noever@gmail.com, westeri@kernel.org, YehezkelShB@gmail.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
WenTao Liang <vulab@iscas.ac.cn>,
stable@vger.kernel.org
Subject: [PATCH] fix: drivers/thunderbolt: tb_tunnel_pci: missing tb_tunnel_put on success path
Date: Sat, 27 Jun 2026 10:46:40 +0800 [thread overview]
Message-ID: <20260627024640.57118-1-vulab@iscas.ac.cn> (raw)
In tb_tunnel_pci(), tb_tunnel_alloc_pci() allocates a tunnel with kref
initialized to 1. On the success path, the tunnel is added to the tunnel
list via list_add_tail() but tb_tunnel_put() is never called to release
the initial reference. On the error path (tb_tunnel_activate failure),
tb_tunnel_put() is correctly called.
Add tb_tunnel_put(tunnel) after list_add_tail() on the success path.
Cc: stable@vger.kernel.org
Fixes: 99cabbb006f1 ("thunderbolt: Add support for full PCIe daisy chains")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
---
drivers/thunderbolt/tb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index c69c323e6952..57c9839b133f 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -2313,6 +2313,7 @@ static int tb_tunnel_pci(struct tb *tb, struct tb_switch *sw)
tb_sw_warn(sw, "failed to connect xHCI\n");
list_add_tail(&tunnel->list, &tcm->tunnel_list);
+ tb_tunnel_put(tunnel);
return 0;
}
--
2.39.5 (Apple Git-154)
next reply other threads:[~2026-06-27 2:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-27 2:46 WenTao Liang [this message]
2026-07-27 10:19 ` Mika Westerberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260627024640.57118-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=westeri@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®