Potentially uninitialized local variables 'TableKey' and 'TableHeader'
might be used in functions RamDiskPublishNfit() and RamDiskUnpublishNfit()
in file RamDiskProtocol.c.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <[email protected]>
---
 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c
index ed71849..9383de4 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c
@@ -201,8 +201,10 @@ RamDiskPublishNfit (
   //
   // Determine whether there is a NFIT already in the ACPI table.
   //
-  Status = EFI_SUCCESS;
-  TableIndex = 0;
+  Status      = EFI_SUCCESS;
+  TableIndex  = 0;
+  TableKey    = 0;
+  TableHeader = NULL;
 
   while (!EFI_ERROR (Status)) {
     Status = mAcpiSdtProtocol->GetAcpiTable (
@@ -386,8 +388,10 @@ RamDiskUnpublishNfit (
   //
   // Find the NFIT in the ACPI table.
   //
-  Status = EFI_SUCCESS;
-  TableIndex = 0;
+  Status      = EFI_SUCCESS;
+  TableIndex  = 0;
+  TableKey    = 0;
+  TableHeader = NULL;
 
   while (!EFI_ERROR (Status)) {
     Status = mAcpiSdtProtocol->GetAcpiTable (
-- 
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to