]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FmpDevicePkg/FmpDxe/VariableSupport.c
FmpDevicePkg: Fix code style issue
[mirror_edk2.git] / FmpDevicePkg / FmpDxe / VariableSupport.c
index c15178d09914c21ba484663a328d00401d72e1f7..b7e4cb98962881316b249f0c5c9be227d415a052 100644 (file)
@@ -1,4 +1,4 @@
-/**  @file\r
+/** @file\r
   UEFI variable support functions for Firmware Management Protocol based\r
   firmware updates.\r
 \r
@@ -72,7 +72,7 @@ GetVersionFromVariable (
   Version = DEFAULT_VERSION;\r
 \r
   Status = GetVariable2 (VARNAME_VERSION, &gEfiCallerIdGuid, (VOID **)&Value, &Size);\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || (Value == NULL)) {\r
     DEBUG ((DEBUG_ERROR, "Failed to get the Version from variable.  Status = %r\n", Status));\r
     return Version;\r
   }\r
@@ -125,7 +125,7 @@ GetLowestSupportedVersionFromVariable (
   Version = DEFAULT_LOWESTSUPPORTEDVERSION;\r
 \r
   Status = GetVariable2 (VARNAME_LSV, &gEfiCallerIdGuid, (VOID **)&Value, &Size);\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || (Value == NULL)) {\r
     DEBUG ((DEBUG_WARN, "Warning: Failed to get the Lowest Supported Version from variable.  Status = %r\n", Status));\r
     return Version;\r
   }\r
@@ -177,7 +177,7 @@ GetLastAttemptStatusFromVariable (
   LastAttemptStatus     = DEFAULT_LASTATTEMPT;\r
 \r
   Status = GetVariable2 (VARNAME_LASTATTEMPTSTATUS, &gEfiCallerIdGuid, (VOID **)&Value, &Size);\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || (Value == NULL)) {\r
     DEBUG ((DEBUG_WARN, "Warning: Failed to get the Last Attempt Status from variable.  Status = %r\n", Status));\r
     return LastAttemptStatus;\r
   }\r
@@ -233,7 +233,7 @@ GetLastAttemptVersionFromVariable (
   Version = DEFAULT_LASTATTEMPT;\r
 \r
   Status = GetVariable2 (VARNAME_LASTATTEMPTVERSION, &gEfiCallerIdGuid, (VOID **)&Value, &Size);\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || (Value == NULL)) {\r
     DEBUG ((DEBUG_WARN, "Warning: Failed to get the Last Attempt Version from variable.  Status = %r\n", Status));\r
     return Version;\r
   }\r
@@ -305,8 +305,8 @@ SetVersionInVariable (
 \r
   UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"FmpLsv"\r
 \r
-  @param[in] LowestSupported  The lowest supported version of the firmware image\r
-                              in the firmware device.\r
+  @param[in] LowestSupportedVersion The lowest supported version of the firmware image\r
+                                    in the firmware device.\r
 \r
 **/\r
 VOID\r