]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
Fix issue from code scrub.
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / BootMaint / BootOption.c
index acfd548e5ec478bfb9c56559dc9dc1d799d5f6b4..e9caf5958a5f813fd62b0eeb8163099cb5f3a05d 100644 (file)
@@ -847,7 +847,8 @@ BOpt_FreeLegacyOptions (
 \r
   @param CallbackData The BMM context data.\r
 \r
-  @return The number of the Var Boot####.\r
+  @return EFI_NOT_FOUND Fail to find "BootOrder" variable.\r
+  @return EFI_SUCESS    Success build boot option menu.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -892,7 +893,10 @@ BOpt_GetBootOptions (
                     &gEfiGlobalVariableGuid,\r
                     &BootOrderListSize\r
                     );\r
-\r
+  if (BootOrderList == NULL) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+  \r
   //\r
   // Get the BootNext from the Var\r
   //\r
@@ -1067,7 +1071,7 @@ BOpt_GetBootOptions (
     FreePool (BootOrderList);\r
   }\r
   BootOptionMenu.MenuNumber = MenuCount;\r
-  return MenuCount;\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -1493,9 +1497,9 @@ BOpt_GetDriverOptionNumber (
 \r
   @param CallbackData The BMM context data.\r
 \r
-  @return EFI_SUCESS The functin completes successfully.\r
+  @retval EFI_SUCESS           The functin completes successfully.\r
   @retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.\r
-  \r
+  @retval EFI_NOT_FOUND        Fail to get "DriverOrder" variable.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1532,7 +1536,10 @@ BOpt_GetDriverOptions (
                       &gEfiGlobalVariableGuid,\r
                       &DriverOrderListSize\r
                       );\r
-\r
+  if (DriverOrderList == NULL) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+  \r
   for (Index = 0; Index < DriverOrderListSize / sizeof (UINT16); Index++) {\r
     UnicodeSPrint (\r
       DriverString,\r