summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2019-08-05 16:43:37 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-29 16:53:35 +0000
commit4d23a7ec84e37cab2a30aaddb3e689c042776561 (patch)
treee9c9f07aea56303ff3b9efad29a39be4b7d84dc5 /DynamicTablesPkg
parent4817953949e939687e428249cea1607cd66a134a (diff)
downloadedk2-4d23a7ec84e37cab2a30aaddb3e689c042776561.tar.gz
edk2-4d23a7ec84e37cab2a30aaddb3e689c042776561.tar.bz2
edk2-4d23a7ec84e37cab2a30aaddb3e689c042776561.zip
DynamicTablesPkg: PPTT: Fix uninitialized memory usage
On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported as some variables that were being logged were uninitialised. To fix this, moved the logging code after the variables being logged are initialised. 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/AcpiPpttLibArm/PpttGenerator.c59
1 files changed, 29 insertions, 30 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index 82070403ac..d70fc59e75 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
@@ -1203,6 +1203,17 @@ BuildPpttTable (
Generator->ProcHierarchyNodeCount,
&NodeIndexer
);
+
+ DEBUG ((
+ DEBUG_INFO,
+ " ProcHierarchyNodeCount = %d\n" \
+ " ProcHierarchyNodeOffset = 0x%x\n" \
+ " ProcHierarchyNodeIndexedList = 0x%p\n",
+ Generator->ProcHierarchyNodeCount,
+ ProcHierarchyNodeOffset,
+ Generator->ProcHierarchyNodeIndexedList
+ ));
+
}
// Include the size of Cache Type Structures and index them
@@ -1215,6 +1226,15 @@ BuildPpttTable (
Generator->CacheStructCount,
&NodeIndexer
);
+ DEBUG ((
+ DEBUG_INFO,
+ " CacheStructCount = %d\n" \
+ " CacheStructOffset = 0x%x\n" \
+ " CacheStructIndexedList = 0x%p\n",
+ Generator->CacheStructCount,
+ CacheStructOffset,
+ Generator->CacheStructIndexedList
+ ));
}
// Include the size of ID Type Structures and index them
@@ -1227,6 +1247,15 @@ BuildPpttTable (
Generator->IdStructCount,
&NodeIndexer
);
+ DEBUG ((
+ DEBUG_INFO,
+ " IdStructCount = %d\n" \
+ " IdStructOffset = 0x%x\n" \
+ " IdStructIndexedList = 0x%p\n",
+ Generator->IdStructCount,
+ IdStructOffset,
+ Generator->IdStructIndexedList
+ ));
}
DEBUG ((
@@ -1238,36 +1267,6 @@ BuildPpttTable (
TableSize
));
- DEBUG ((
- DEBUG_INFO,
- " ProcHierarchyNodeCount = %d\n" \
- " ProcHierarchyNodeOffset = 0x%x\n" \
- " ProcHierarchyNodeIndexedList = 0x%p\n",
- Generator->ProcHierarchyNodeCount,
- ProcHierarchyNodeOffset,
- Generator->ProcHierarchyNodeIndexedList
- ));
-
- DEBUG ((
- DEBUG_INFO,
- " CacheStructCount = %d\n" \
- " CacheStructOffset = 0x%x\n" \
- " CacheStructIndexedList = 0x%p\n",
- Generator->CacheStructCount,
- CacheStructOffset,
- Generator->CacheStructIndexedList
- ));
-
- DEBUG ((
- DEBUG_INFO,
- " IdStructCount = %d\n" \
- " IdStructOffset = 0x%x\n" \
- " IdStructIndexedList = 0x%p\n",
- Generator->IdStructCount,
- IdStructOffset,
- Generator->IdStructIndexedList
- ));
-
// Allocate the Buffer for the PPTT table
*Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize);
if (*Table == NULL) {