summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Garver <jake@nvidia.com>2024-10-29 06:06:22 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-03-12 14:26:14 +0000
commit8e9d56f8eebebbc8873200504f291e4e23799e74 (patch)
tree98cc8e33eebd29504c27b14303cea6f47ab6adb4
parentdfe43d74bc1640881d613a43250f3426b216673a (diff)
downloadedk2-8e9d56f8eebebbc8873200504f291e4e23799e74.zip
edk2-8e9d56f8eebebbc8873200504f291e4e23799e74.tar.gz
edk2-8e9d56f8eebebbc8873200504f291e4e23799e74.tar.bz2
DynamicTablesPkg: Tolerate NULL when freeing MADT table
In some failure legs of BuildMadtTable (), we could end up in FreeMadtTableResources () with (*Table == NULL). That's a valid error state and should be tolerated by FreeMadtTableResources () instead of ASSERTing. Signed-off-by: Jake Garver <jake@nvidia.com> Reviewed-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Jeshua Smith <jeshuas@nvidia.com>
-rw-r--r--DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
index 0b3280a..88964b9 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
@@ -753,10 +753,10 @@ FreeMadtTableResources (
ASSERT (CfgMgrProtocol != NULL);
ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
+ ASSERT (Table != NULL);
if ((Table == NULL) || (*Table == NULL)) {
DEBUG ((DEBUG_ERROR, "ERROR: MADT: Invalid Table Pointer\n"));
- ASSERT ((Table != NULL) && (*Table != NULL));
return EFI_INVALID_PARAMETER;
}