From: Gustavo A. R. Silva Date: Sun, 5 Nov 2017 04:52:54 +0000 (-0500) Subject: thunderbolt: tb: fix use after free in tb_activate_pcie_devices X-Git-Tag: v4.14.8~113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4e7af283374329a6eca97dfa782d710417f3e19;p=platform%2Fkernel%2Flinux-exynos.git thunderbolt: tb: fix use after free in tb_activate_pcie_devices [ Upstream commit a2e373438f72391493a4425efc1b82030b6b4fd5 ] Add a ̣̣continue statement in order to avoid using a previously free'd pointer tunnel in list_add. Addresses-Coverity-ID: 1415336 Fixes: 9d3cce0b6136 ("thunderbolt: Introduce thunderbolt bus and connection manager") Signed-off-by: Gustavo A. R. Silva Acked-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index d674e06..1424581 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -225,6 +225,7 @@ static void tb_activate_pcie_devices(struct tb *tb) tb_port_info(up_port, "PCIe tunnel activation failed, aborting\n"); tb_pci_free(tunnel); + continue; } list_add(&tunnel->list, &tcm->tunnel_list);