]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FmpDevicePkg/FmpDxe/FmpDxe.c
FmpDevicePkg/FmpDxe: Fix Clang build error
[mirror_edk2.git] / FmpDevicePkg / FmpDxe / FmpDxe.c
index 854feec0a162b1fce7a6af0f886a60331b543037..427b215ddc5f084516dfb53a8bace29be1cc2d2c 100644 (file)
@@ -1043,6 +1043,7 @@ SetTheImage (
   UINT32                            DependenciesSize;\r
 \r
   Status             = EFI_SUCCESS;\r
+  Private            = NULL;\r
   Updateable         = 0;\r
   BooleanValue       = FALSE;\r
   FmpHeaderSize      = 0;\r
@@ -1293,7 +1294,10 @@ SetTheImage (
 \r
 cleanup:\r
   mProgressFunc = NULL;\r
-  SetLastAttemptStatusInVariable (Private, LastAttemptStatus);\r
+\r
+  if (Private != NULL) {\r
+    SetLastAttemptStatusInVariable (Private, LastAttemptStatus);\r
+  }\r
 \r
   if (Progress != NULL) {\r
     //\r
@@ -1306,7 +1310,9 @@ cleanup:
   // Need repopulate after SetImage is called to\r
   // update LastAttemptVersion and LastAttemptStatus.\r
   //\r
-  Private->DescriptorPopulated = FALSE;\r
+  if (Private != NULL) {\r
+    Private->DescriptorPopulated = FALSE;\r
+  }\r
 \r
   return Status;\r
 }\r