]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStart
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 13 Apr 2018 04:13:52 +0000 (12:13 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 3 May 2018 03:29:49 +0000 (11:29 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=917

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c

index 60de2d4d6db2b09f8937226465ca98e9c2660d21..66dd3ad550f2e58ad3b5796639edc1149cded74d 100644 (file)
@@ -2,7 +2,7 @@
   Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and\r
   Simple Text Output Protocol upon Serial IO Protocol.\r
 \r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -488,6 +488,9 @@ TerminalDriverBindingStart (
                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
                   );\r
   ASSERT ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED));\r
+  if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Open the Serial I/O Protocol BY_DRIVER.  It might already be started.\r
@@ -501,6 +504,9 @@ TerminalDriverBindingStart (
                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
                   );\r
   ASSERT ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED));\r
+  if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {\r
+    return Status;\r
+  }\r
 \r
   if (!IsHotPlugDevice (ParentDevicePath)) {\r
     //\r