From ac2b16d3b11b88ba1f3023de3645575542be4ca3 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Wed, 23 Feb 2022 13:38:58 -0300 Subject: [PATCH] libefivar: Correct condition check for AcpiExp text format According to UEFI Spec, for ACPI Expanded Device Path, when HIDSTR=empty, CIDSTR=empty, UID STR!=empty, the ACPI Expanded Device Path node can be displayed as AcpiExp(HID,CID,UIDSTR) format. And if UID is 0 and UIDSTR is empty, then use AcpiEx format. This patch is to correct the condition check to follow UEFI Spec when convert the device path node to the AcpiExp text format. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1226 Obtained from: https://github.com/tianocore/edk2/commit/fb4bea551e5b7e16e54676bca3d1ccde65f57c77 Pull Request: https://github.com/freebsd/freebsd-src/pull/581 --- lib/libefivar/efivar-dp-format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index 7abbce033f1d..24f4cdc94d98 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -514,7 +514,7 @@ DevPathToTextAcpiEx ( (AcpiEx->CID >> 16) & 0xFFFF ); - if ((*HIDStr == '\0') && (*CIDStr == '\0') && (AcpiEx->UID == 0)) { + if ((*HIDStr == '\0') && (*CIDStr == '\0') && (*UIDStr != '\0')) { // // use AcpiExp() //