summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/UefiBootManagerLib
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2017-11-20 13:13:25 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2017-11-22 17:50:39 +0800
commita0a03415d6d44da3a7d84c140444039de992a192 (patch)
treecaaa37dbb49f9f6fa0347fa97b530a49b12d84d3 /MdeModulePkg/Library/UefiBootManagerLib
parent827330ccd1d0983fe4d059fee518bf42c70ef31e (diff)
downloadedk2-a0a03415d6d44da3a7d84c140444039de992a192.tar.gz
edk2-a0a03415d6d44da3a7d84c140444039de992a192.tar.bz2
edk2-a0a03415d6d44da3a7d84c140444039de992a192.zip
MdeModulePkg/UefiBootManagerLib: Remove assertion
EfiBootManagerStartHotkeyService() asserts when "BootOptionSupport" variable doesn't exist. In fact, though "BootOptionSupport" variable is set in BdsDxe module, it's possible that the variable is deleted by PlatformBootManagerBeforeConsole(). The patch removes the assertion and adds code to handle the case. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/UefiBootManagerLib')
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
index efad073880..d18ce02eb3 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
@@ -870,13 +870,13 @@ EfiBootManagerStartHotkeyService (
EFI_EVENT Event;
UINT32 *BootOptionSupport;
- Status = GetEfiGlobalVariable2 (EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, (VOID **) &BootOptionSupport, NULL);
- ASSERT (BootOptionSupport != NULL);
-
- if ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_KEY) != 0) {
- mBmHotkeySupportCount = ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_COUNT) >> LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT));
+ GetEfiGlobalVariable2 (EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, (VOID **) &BootOptionSupport, NULL);
+ if (BootOptionSupport != NULL) {
+ if ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_KEY) != 0) {
+ mBmHotkeySupportCount = ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_COUNT) >> LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT));
+ }
+ FreePool (BootOptionSupport);
}
- FreePool (BootOptionSupport);
if (mBmHotkeySupportCount == 0) {
DEBUG ((EFI_D_INFO, "Bds: BootOptionSupport NV variable forbids starting the hotkey service.\n"));