thunderbolt: Fix possible NULL pointer dereference in tb_acpi_add_link()
commit4d395c5e74
upstream. 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:b2be2b05cf
("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
19155473f3
commit
0e5cb872fb
@ -56,7 +56,7 @@ static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data,
|
|||||||
* managed with the xHCI and the SuperSpeed hub so we create the
|
* managed with the xHCI and the SuperSpeed hub so we create the
|
||||||
* link from xHCI instead.
|
* link from xHCI instead.
|
||||||
*/
|
*/
|
||||||
while (!dev_is_pci(dev))
|
while (dev && !dev_is_pci(dev))
|
||||||
dev = dev->parent;
|
dev = dev->parent;
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
|
Reference in New Issue
Block a user