summaryrefslogtreecommitdiff
path: root/DynamicTablesPkg
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2019-08-05 16:30:38 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-29 16:53:35 +0000
commit4817953949e939687e428249cea1607cd66a134a (patch)
tree7d304b1739ab732e825d0dc8c08df3b8ef0f36d5 /DynamicTablesPkg
parent8b2ac43bd8398c3e9559696de3f44ffaf455006e (diff)
downloadedk2-4817953949e939687e428249cea1607cd66a134a.zip
edk2-4817953949e939687e428249cea1607cd66a134a.tar.gz
edk2-4817953949e939687e428249cea1607cd66a134a.tar.bz2
DynamicTablesPkg: IORT: 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/AcpiIortLibArm/IortGenerator.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index bd71220..65d006c 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -1738,6 +1738,14 @@ BuildIortTable (
goto error_handler;
}
TableSize += NodeSize;
+
+ DEBUG ((
+ DEBUG_INFO,
+ " ItsGroupNodeCount = %d\n" \
+ " ItsGroupOffset = %d\n",
+ ItsGroupNodeCount,
+ ItsGroupOffset
+ ));
}
// Named Component Nodes
@@ -1760,6 +1768,14 @@ BuildIortTable (
goto error_handler;
}
TableSize += NodeSize;
+
+ DEBUG ((
+ DEBUG_INFO,
+ " NamedComponentNodeCount = %d\n" \
+ " NamedComponentOffset = %d\n",
+ NamedComponentNodeCount,
+ NamedComponentOffset
+ ));
}
// Root Complex Nodes
@@ -1782,6 +1798,14 @@ BuildIortTable (
goto error_handler;
}
TableSize += NodeSize;
+
+ DEBUG ((
+ DEBUG_INFO,
+ " RootComplexNodeCount = %d\n" \
+ " RootComplexOffset = %d\n",
+ RootComplexNodeCount,
+ RootComplexOffset
+ ));
}
// SMMUv1/SMMUv2 Nodes
@@ -1804,6 +1828,14 @@ BuildIortTable (
goto error_handler;
}
TableSize += NodeSize;
+
+ DEBUG ((
+ DEBUG_INFO,
+ " SmmuV1V2NodeCount = %d\n" \
+ " SmmuV1V2Offset = %d\n",
+ SmmuV1V2NodeCount,
+ SmmuV1V2Offset
+ ));
}
// SMMUv3 Nodes
@@ -1826,6 +1858,14 @@ BuildIortTable (
goto error_handler;
}
TableSize += NodeSize;
+
+ DEBUG ((
+ DEBUG_INFO,
+ " SmmuV3NodeCount = %d\n" \
+ " SmmuV3Offset = %d\n",
+ SmmuV3NodeCount,
+ SmmuV3Offset
+ ));
}
// PMCG Nodes
@@ -1848,6 +1888,14 @@ BuildIortTable (
goto error_handler;
}
TableSize += NodeSize;
+
+ DEBUG ((
+ DEBUG_INFO,
+ " PmcgNodeCount = %d\n" \
+ " PmcgOffset = %d\n",
+ PmcgNodeCount,
+ PmcgOffset
+ ));
}
DEBUG ((
@@ -1859,54 +1907,6 @@ BuildIortTable (
TableSize
));
- DEBUG ((
- DEBUG_INFO,
- " ItsGroupNodeCount = %d\n" \
- " ItsGroupOffset = %d\n",
- ItsGroupNodeCount,
- ItsGroupOffset
- ));
-
- DEBUG ((
- DEBUG_INFO,
- " NamedComponentNodeCount = %d\n" \
- " NamedComponentOffset = %d\n",
- NamedComponentNodeCount,
- NamedComponentOffset
- ));
-
- DEBUG ((
- DEBUG_INFO,
- " RootComplexNodeCount = %d\n" \
- " RootComplexOffset = %d\n",
- RootComplexNodeCount,
- RootComplexOffset
- ));
-
- DEBUG ((
- DEBUG_INFO,
- " SmmuV1V2NodeCount = %d\n" \
- " SmmuV1V2Offset = %d\n",
- SmmuV1V2NodeCount,
- SmmuV1V2Offset
- ));
-
- DEBUG ((
- DEBUG_INFO,
- " SmmuV3NodeCount = %d\n" \
- " SmmuV3Offset = %d\n",
- SmmuV3NodeCount,
- SmmuV3Offset
- ));
-
- DEBUG ((
- DEBUG_INFO,
- " PmcgNodeCount = %d\n" \
- " PmcgOffset = %d\n",
- PmcgNodeCount,
- PmcgOffset
- ));
-
if (TableSize > MAX_UINT32) {
Status = EFI_INVALID_PARAMETER;
DEBUG ((