Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
Cc: Feng Tian <feng.t...@intel.com>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c
index 4cc4fb4..b49758b 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;
 }
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to