summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
authorCoolStar <coolstarorganization@gmail.com>2023-08-24 02:00:50 -0700
committerMatt DeVillier <matt.devillier@amd.corp-partner.google.com>2023-11-16 22:18:25 +0000
commit42be899b6501cb8aa93329a2143a35765f0c4dd8 (patch)
treebb5a0b1985a0e544a81ab8cad2eaed2b9ee06693 /src/acpi
parent31327d8b4bc74cc24e2773f3d59fb50cd02109ef (diff)
acpi/device: Only return dev->ops->acpi_name if non-NULL
Returning a NULL device name can cause issues if something else does handle it. E.g. UART and GNA devices on Intel Alder Lake-N cause INTERNAL_POWER_ERROR BSOD's in Windows when enabled due to invalid packages being created from a NULL name Test: build/boot google/nissa (craaskvin) to Win11 Change-Id: I0679147ad3e330d706bbf97c30bc11b2432e2e8a Signed-off-by: CoolStar <coolstarorganization@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77413 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/acpi/device.c b/src/acpi/device.c
index b76357e675..92000a3d8b 100644
--- a/src/acpi/device.c
+++ b/src/acpi/device.c
@@ -76,8 +76,11 @@ const char *acpi_device_name(const struct device *dev)
return NULL;
/* Check for device specific handler */
- if (dev->ops && dev->ops->acpi_name)
- return dev->ops->acpi_name(dev);
+ if (dev->ops && dev->ops->acpi_name) {
+ name = dev->ops->acpi_name(dev);
+ if (name)
+ return name;
+ }
/* Walk up the tree to find if any parent can identify this device */
while (pdev->bus) {