[edk2-devel] [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable
Chiu, Chasel
chasel.chiu at intel.com
Thu Sep 12 04:06:05 UTC 2019
Reviewed-by: Chasel Chiu <chasel.chiu at intel.com>
> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Thursday, September 12, 2019 11:27 AM
> To: devel at edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki at intel.com>; Chiu, Chasel
> <chasel.chiu at intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone at intel.com>; Gao, Liming <liming.gao at intel.com>
> Subject: [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error handling to
> SortCpuLocalApicInTable
>
> Change ASSERT_EFI_ERROR to return value when the "if" statement is true.
> As a result, when SortCpuLocalApicInTable is called, error handling is
> needed. So add "if" statement to judge the returned Status from
> SortCpuLocalApicInTable () in function InstallMadtFromScratch().
>
> Cc: Michael Kubacki <michael.a.kubacki at intel.com>
> Cc: Chasel Chiu <chasel.chiu at intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
> Cc: Liming Gao <liming.gao at intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang at intel.com>
> ---
> .../Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> index 2cc55ee8..ae25d753 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> @@ -354,7 +354,7 @@ SortCpuLocalApicInTable (
>
> if(MAX_CPU_NUM <= Index) {
> DEBUG ((EFI_D_ERROR, "Asserting the SortCpuLocalApicInTable
> Index Bufferflow\n"));
> - ASSERT_EFI_ERROR(EFI_INVALID_PARAMETER);
> + return EFI_INVALID_PARAMETER;
> }
>
> TempVal = mCpuApicIdOrderTable[Index].ApicId;
> @@ -874,7 +874,11 @@ InstallMadtFromScratch (
> DetectApicIdMap();
>
> // Call for Local APIC ID Reorder
> - SortCpuLocalApicInTable ();
> + Status = SortCpuLocalApicInTable ();
> + if (EFI_ERROR (Status)) {
> + DEBUG ((EFI_D_ERROR, "SortCpuLocalApicInTable failed: %r\n",
> Status));
> + goto Done;
> + }
>
> MaxMadtStructCount = (UINT32) (
> MAX_CPU_NUM + // processor local APIC structures
> --
> 2.18.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#47166): https://edk2.groups.io/g/devel/message/47166
Mute This Topic: https://groups.io/mt/34111553/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list