summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/BdsDxe
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-11-15 17:50:43 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-11-18 10:42:04 +0800
commitde67c35c8a074500e1db86829e9aa164b7cf4b9d (patch)
tree5416a9417715bf93542bdef22db7ec7e2ce8a9bf /MdeModulePkg/Universal/BdsDxe
parent3fc46b79d82922f33af29bf6c9d0de0062ebda12 (diff)
downloadedk2-de67c35c8a074500e1db86829e9aa164b7cf4b9d.zip
edk2-de67c35c8a074500e1db86829e9aa164b7cf4b9d.tar.gz
edk2-de67c35c8a074500e1db86829e9aa164b7cf4b9d.tar.bz2
MdeModulePkg/BdsDxe: Fix bug to run non-first PlatformRecovery####
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>
Diffstat (limited to 'MdeModulePkg/Universal/BdsDxe')
-rw-r--r--MdeModulePkg/Universal/BdsDxe/BdsEntry.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 72adc51..32bcbf3 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -443,17 +443,28 @@ ProcessLoadOptions (
LoadOptionType = LoadOptions[Index].OptionType;
}
ASSERT (LoadOptionType == LoadOptions[Index].OptionType);
+ ASSERT (LoadOptionType != LoadOptionTypeBoot);
Status = EfiBootManagerProcessLoadOption (&LoadOptions[Index]);
+ //
+ // Status indicates whether the load option is loaded and executed
+ // LoadOptions[Index].Status is what the load option returns
+ //
if (!EFI_ERROR (Status)) {
- if (LoadOptionType == LoadOptionTypePlatformRecovery) {
- //
- // Stop processing if any entry is successful
- //
+ //
+ // Stop processing if any PlatformRecovery#### returns success.
+ //
+ if ((LoadOptions[Index].Status == EFI_SUCCESS) &&
+ (LoadOptionType == LoadOptionTypePlatformRecovery)) {
break;
}
- if ((LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) {
+
+ //
+ // Only set ReconnectAll flag when the load option executes successfully.
+ //
+ if (!EFI_ERROR (LoadOptions[Index].Status) &&
+ (LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) {
ReconnectAll = TRUE;
}
}