]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DynamicTablesPkg: Fix order of assert checks
authorSami Mujawar <sami.mujawar@arm.com>
Thu, 3 Sep 2020 10:45:07 +0000 (11:45 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 21 Oct 2020 13:33:03 +0000 (13:33 +0000)
Reordered the asserts to first check if the pointer is valid
before de-referencing the pointer.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c

index 2197e50dc714707f7ed7cc37759d3dba5a45f0e0..a705d771be1a2d59c4b0f645269eb838ff605a1a 100644 (file)
@@ -90,10 +90,10 @@ FreeSsdtSerialPortTableEx (
   UINTN                             Index;\r
 \r
   ASSERT (This != NULL);\r
+  ASSERT (AcpiTableInfo != NULL);\r
+  ASSERT (CfgMgrProtocol != NULL);\r
   ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);\r
   ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);\r
-  ASSERT (CfgMgrProtocol != NULL);\r
-  ASSERT (AcpiTableInfo != NULL);\r
 \r
   if ((Table == NULL)   ||\r
       (*Table == NULL)  ||\r