From 42be899b6501cb8aa93329a2143a35765f0c4dd8 Mon Sep 17 00:00:00 2001 From: CoolStar Date: Thu, 24 Aug 2023 02:00:50 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77413 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Felix Singer --- src/acpi/device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3