diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-10-08 11:49:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-10-08 11:49:30 -0700 |
commit | cdc726fb35ede5dad4ae362e35f3ee5507299030 (patch) | |
tree | 74d95e4586b05db4f15f1dc0b08945c98f306599 | |
parent | 741668ef78320a2c1aacbfecea43ac884d989ec1 (diff) | |
parent | 3fb937f441c64af1eec60bfd3732f64001fcc534 (diff) | |
download | linux-cdc726fb35ede5dad4ae362e35f3ee5507299030.tar.bz2 |
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()
-rw-r--r-- | drivers/pci/pci-acpi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 0f40943a9a18..260a06fb78a6 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -1249,6 +1249,9 @@ static struct acpi_device *acpi_pci_find_companion(struct device *dev) bool check_children; u64 addr; + if (!dev->parent) + return NULL; + down_read(&pci_acpi_companion_lookup_sem); adev = pci_acpi_find_companion_hook ? |