Skip to content

Commit 72cef52

Browse files
aborzeszwesteri
authored andcommitted
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>
1 parent 35ad0d6 commit 72cef52

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/thunderbolt/tunnel.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,19 +2224,15 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
22242224

22252225
path = tb_path_alloc(tb, down, TB_USB3_HOPID, up, TB_USB3_HOPID, 0,
22262226
"USB3 Down");
2227-
if (!path) {
2228-
tb_tunnel_put(tunnel);
2229-
return NULL;
2230-
}
2227+
if (!path)
2228+
goto err_free;
22312229
tb_usb3_init_path(path);
22322230
tunnel->paths[TB_USB3_PATH_DOWN] = path;
22332231

22342232
path = tb_path_alloc(tb, up, TB_USB3_HOPID, down, TB_USB3_HOPID, 0,
22352233
"USB3 Up");
2236-
if (!path) {
2237-
tb_tunnel_put(tunnel);
2238-
return NULL;
2239-
}
2234+
if (!path)
2235+
goto err_free;
22402236
tb_usb3_init_path(path);
22412237
tunnel->paths[TB_USB3_PATH_UP] = path;
22422238

@@ -2253,6 +2249,10 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
22532249
}
22542250

22552251
return tunnel;
2252+
2253+
err_free:
2254+
tb_tunnel_put(tunnel);
2255+
return NULL;
22562256
}
22572257

22582258
/**

0 commit comments

Comments
 (0)