thunderbolt: Fix possible NULL pointer dereference in tb_acpi_add_link()
authorMario Limonciello <mario.limonciello@dell.com>
Mon, 26 Oct 2020 16:12:59 +0000 (19:12 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 28 Jan 2021 12:30:57 +0000 (15:30 +0300)
commit4d395c5e74398f664405819330e5a298da37f655
treee45b2bcca89fff8be148bf659ee4c4b223443225
parent6ee1d745b7c9fd573fba142a2efdad76a9f1cb04
thunderbolt: Fix possible NULL pointer dereference in tb_acpi_add_link()

When we walk up the device hierarchy in tb_acpi_add_link() make sure we
break the loop if the device has no parent. Otherwise we may crash the
kernel by dereferencing a NULL pointer.

Fixes: b2be2b05cf3b ("thunderbolt: Create device links from ACPI description")
Cc: stable@vger.kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/acpi.c