From 8278071ae17976490f08e8154f226178abf319ea Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Wed, 23 Feb 2022 13:45:14 -0300 Subject: [PATCH] libefivar: Correct the string order of ACPI Expanded Device Path According to UEFI Spec, ACPI Expanded Device Path can be display AcpiEx(HID|HIDSTR,(CID|CIDSTR,UID|UIDSTR)), but current code display UID|UIDSTR before CID|CIDSTR. This patch is to fix this issue. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1227 Obtained from: https://github.com/tianocore/edk2/commit/05fe7525896cee197cfed98154955dbaa60d6357 Pull Request: https://github.com/freebsd/freebsd-src/pull/581 --- lib/libefivar/efivar-dp-format.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index 2256a2013ad4..7abbce033f1d 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -536,16 +536,16 @@ DevPathToTextAcpiEx ( UefiDevicePathLibCatPrint (Str, "AcpiEx(%s,", HIDText); } - if (AcpiEx->UID == 0) { - UefiDevicePathLibCatPrint (Str, "%s,", UIDStr); + if (AcpiEx->CID == 0) { + UefiDevicePathLibCatPrint (Str, "%s,", CIDStr); } else { - UefiDevicePathLibCatPrint (Str, "0x%x,", AcpiEx->UID); + UefiDevicePathLibCatPrint (Str, "%s,", CIDText); } - if (AcpiEx->CID == 0) { - UefiDevicePathLibCatPrint (Str, "%s)", CIDStr); + if (AcpiEx->UID == 0) { + UefiDevicePathLibCatPrint (Str, "%s)", UIDStr); } else { - UefiDevicePathLibCatPrint (Str, "%s)", CIDText); + UefiDevicePathLibCatPrint (Str, "0x%x)", AcpiEx->UID); } } else { UefiDevicePathLibCatPrint (