]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit605574807d3ffd9bb5cc19dcc218f8c15c549d29
treee45b2bcca89fff8be148bf659ee4c4b223443225
parentbb30d010fcc33a6e59b2b501e4ba1a6982895115
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: 2facb3da413d ("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