summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBret Barkelew <bret@corthon.com>2024-07-29 21:34:36 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-25 18:48:06 +0000
commit00ccd99d46068c87e73e8e521afea09e19419885 (patch)
treed08aa4b7121741459fe78c856d227ef253aa245b
parent1c0f3c3e41157a71fc206a7b3bbba752c1866dd3 (diff)
downloadedk2-00ccd99d46068c87e73e8e521afea09e19419885.tar.gz
FatPkg: Fix potentially uninitialized variable
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1559 Initializes the variable to prevent an uninitialized variable warning in Visual Studio with C4701 enabled. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
-rw-r--r--FatPkg/EnhancedFatDxe/Info.c2
-rw-r--r--FatPkg/FatPei/FatLiteApi.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/FatPkg/EnhancedFatDxe/Info.c b/FatPkg/EnhancedFatDxe/Info.c
index d17ce5b7ee..ab06311965 100644
--- a/FatPkg/EnhancedFatDxe/Info.c
+++ b/FatPkg/EnhancedFatDxe/Info.c
@@ -303,6 +303,8 @@ FatSetFileInfo (
UINT8 NewAttribute;
BOOLEAN ReadOnly;
+ TempDirEnt = NULL;
+
ZeroMem (&ZeroTime, sizeof (EFI_TIME));
Parent = OFile->Parent;
DirEnt = OFile->DirEnt;
diff --git a/FatPkg/FatPei/FatLiteApi.c b/FatPkg/FatPei/FatLiteApi.c
index b89ab7009d..49214a21b4 100644
--- a/FatPkg/FatPei/FatLiteApi.c
+++ b/FatPkg/FatPei/FatLiteApi.c
@@ -426,6 +426,8 @@ GetRecoveryCapsuleInfo (
PEI_FILE_HANDLE Handle;
UINTN NumberRecoveryCapsules;
+ Handle = NULL;
+
Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules);
if (EFI_ERROR (Status)) {
@@ -551,6 +553,8 @@ LoadRecoveryCapsule (
PEI_FILE_HANDLE Handle;
UINTN NumberRecoveryCapsules;
+ Handle = NULL;
+
Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules);
if (EFI_ERROR (Status)) {