summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2020-09-03 11:45:07 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-10-21 13:33:03 +0000
commit653fb710ce2de21544e38ae81941eba01c94426a (patch)
tree278246f853831ab02acf5c731f5aebd5a45f3116 /DynamicTablesPkg
parent26442d11e620a9e81c019a24a4ff38441c64ba10 (diff)
downloadedk2-653fb710ce2de21544e38ae81941eba01c94426a.tar.gz
edk2-653fb710ce2de21544e38ae81941eba01c94426a.tar.bz2
edk2-653fb710ce2de21544e38ae81941eba01c94426a.zip
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 <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Diffstat (limited to 'DynamicTablesPkg')
-rw-r--r--DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c4
1 files 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) ||