]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/BdsDxe: Fix bug to run non-first PlatformRecovery####
authorRuiyu Ni <ruiyu.ni@intel.com>
Tue, 15 Nov 2016 09:50:43 +0000 (17:50 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 18 Nov 2016 02:42:04 +0000 (10:42 +0800)
The implementation doesn't check the LoadOptions[Index].Status but
only depends on the Status returned from
EfiBootManagerProcessLoadOption(), which results only the first
PlatformRecovery#### runs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jie Lin <jie.lin@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
MdeModulePkg/Universal/BdsDxe/BdsEntry.c

index 72adc5155cedf73dcc5cbdc5ccbc796a45e0ddde..32bcbf342eecdd248e78404a067cac6d5533f3c0 100644 (file)
@@ -443,17 +443,28 @@ ProcessLoadOptions (
       LoadOptionType = LoadOptions[Index].OptionType;\r
     }\r
     ASSERT (LoadOptionType == LoadOptions[Index].OptionType);\r
+    ASSERT (LoadOptionType != LoadOptionTypeBoot);\r
 \r
     Status = EfiBootManagerProcessLoadOption (&LoadOptions[Index]);\r
 \r
+    //\r
+    // Status indicates whether the load option is loaded and executed\r
+    // LoadOptions[Index].Status is what the load option returns\r
+    //\r
     if (!EFI_ERROR (Status)) {\r
-      if (LoadOptionType == LoadOptionTypePlatformRecovery) {\r
-        //\r
-        // Stop processing if any entry is successful\r
-        //\r
+      //\r
+      // Stop processing if any PlatformRecovery#### returns success.\r
+      //\r
+      if ((LoadOptions[Index].Status == EFI_SUCCESS) &&\r
+          (LoadOptionType == LoadOptionTypePlatformRecovery)) {\r
         break;\r
       }\r
-      if ((LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) {\r
+\r
+      //\r
+      // Only set ReconnectAll flag when the load option executes successfully.\r
+      //\r
+      if (!EFI_ERROR (LoadOptions[Index].Status) &&\r
+          (LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) {\r
         ReconnectAll = TRUE;\r
       }\r
     }\r