thunderbolt: tb: fix use after free in tb_activate_pcie_devices
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Sun, 5 Nov 2017 04:52:54 +0000 (23:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Nov 2017 17:22:33 +0000 (18:22 +0100)
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 <garsilva@embeddedor.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/tb.c

index 0b22ad9d68b4107ff199f9e0382ee6ccf30e2599..f7d0c60c6a1149d8d8099165a44dde6bfe114533 100644 (file)
@@ -224,6 +224,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);