Skip to content

Commit cdc726f

Browse files
committed
Merge tag 'acpi-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fix from Rafael Wysocki: "Fix a recent ACPI-related regression in the PCI subsystem that introduced a NULL pointer dereference possible to trigger from user space via sysfs on some systems" * tag 'acpi-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PCI: ACPI: Check parent pointer in acpi_pci_find_companion()
2 parents 741668e + 3fb937f commit cdc726f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/pci/pci-acpi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,9 @@ static struct acpi_device *acpi_pci_find_companion(struct device *dev)
12491249
bool check_children;
12501250
u64 addr;
12511251

1252+
if (!dev->parent)
1253+
return NULL;
1254+
12521255
down_read(&pci_acpi_companion_lookup_sem);
12531256

12541257
adev = pci_acpi_find_companion_hook ?

0 commit comments

Comments
 (0)