Skip to content

Commit ed14e59

Browse files
zhengchaoshaokuba-moo
authored andcommitted
net: thunderbolt: fix memory leak in tbnet_open()
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: 180b068 ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection") Signed-off-by: Zhengchao Shao <[email protected]> Acked-by: Mika Westerberg <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 803e848 commit ed14e59

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/thunderbolt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ static int tbnet_open(struct net_device *dev)
914914
eof_mask, tbnet_start_poll, net);
915915
if (!ring) {
916916
netdev_err(dev, "failed to allocate Rx ring\n");
917+
tb_xdomain_release_out_hopid(xd, hopid);
917918
tb_ring_free(net->tx_ring.ring);
918919
net->tx_ring.ring = NULL;
919920
return -ENOMEM;

0 commit comments

Comments
 (0)