diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c index 4cc4fb4554..b49758b236 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c @@ -458,6 +458,9 @@ BmGetActiveConsoleIn ( EFI_STATUS Status; EFI_HANDLE *Handles; + Handles = NULL; + *Count = 0; + if (gST->ConsoleInHandle != NULL) { Status = gBS->OpenProtocol ( gST->ConsoleInHandle, @@ -480,10 +483,6 @@ BmGetActiveConsoleIn ( &Handles ); } - if (EFI_ERROR (Status)) { - Handles = NULL; - *Count = 0; - } return Handles; }