summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Borzeszkowski <alan.borzeszkowski@linux.intel.com>2025-01-21 21:04:01 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2025-02-24 10:36:47 +0300
commit72cef52b353cc693d71ad37d80237d975f9951d9 (patch)
treeda5c6d8b29338bf07a032e785c7beecb61d2be2b
parent35ad0d62da83b2e027e2e3c8b3b265ce6a678c5a (diff)
downloadlinux-72cef52b353cc693d71ad37d80237d975f9951d9.tar.xz
thunderbolt: Make tb_tunnel_alloc_usb3() error paths consistent with the rest
Make the tb_tunnel_alloc_usb3() error codepaths consistent with the DisplayPort and PCIe counterparts. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
-rw-r--r--drivers/thunderbolt/tunnel.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c
index 8229a6fbda5a..072f7e80263e 100644
--- a/drivers/thunderbolt/tunnel.c
+++ b/drivers/thunderbolt/tunnel.c
@@ -2224,19 +2224,15 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
path = tb_path_alloc(tb, down, TB_USB3_HOPID, up, TB_USB3_HOPID, 0,
"USB3 Down");
- if (!path) {
- tb_tunnel_put(tunnel);
- return NULL;
- }
+ if (!path)
+ goto err_free;
tb_usb3_init_path(path);
tunnel->paths[TB_USB3_PATH_DOWN] = path;
path = tb_path_alloc(tb, up, TB_USB3_HOPID, down, TB_USB3_HOPID, 0,
"USB3 Up");
- if (!path) {
- tb_tunnel_put(tunnel);
- return NULL;
- }
+ if (!path)
+ goto err_free;
tb_usb3_init_path(path);
tunnel->paths[TB_USB3_PATH_UP] = path;
@@ -2253,6 +2249,10 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
}
return tunnel;
+
+err_free:
+ tb_tunnel_put(tunnel);
+ return NULL;
}
/**