X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FUefiBootManagerLib%2FBmHotkey.c;h=d18ce02eb3461a0ad52cedcbea73ec130ec9383c;hp=efad073880ae040a73aa79448c1f57a4091ca657;hb=a0a03415d6d44da3a7d84c140444039de992a192;hpb=827330ccd1d0983fe4d059fee518bf42c70ef31e;ds=sidebyside 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"));