From 653fb710ce2de21544e38ae81941eba01c94426a Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Thu, 3 Sep 2020 11:45:07 +0100 Subject: [PATCH] DynamicTablesPkg: Fix order of assert checks Reordered the asserts to first check if the pointer is valid before de-referencing the pointer. Signed-off-by: Sami Mujawar Reviewed-by: Alexei Fedorov --- .../Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c index 2197e50dc7..a705d771be 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c @@ -90,10 +90,10 @@ FreeSsdtSerialPortTableEx ( UINTN Index; ASSERT (This != NULL); + ASSERT (AcpiTableInfo != NULL); + ASSERT (CfgMgrProtocol != NULL); ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); - ASSERT (CfgMgrProtocol != NULL); - ASSERT (AcpiTableInfo != NULL); if ((Table == NULL) || (*Table == NULL) || -- 2.39.2