From nobody Sun May 5 21:20:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523592841020512.5270503657816; Thu, 12 Apr 2018 21:14:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AFF672274F3FC; Thu, 12 Apr 2018 21:13:57 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1E0A82274F3D1 for ; Thu, 12 Apr 2018 21:13:56 -0700 (PDT) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 21:13:56 -0700 Received: from rni2-mobl2.ccr.corp.intel.com ([10.255.28.108]) by fmsmga007.fm.intel.com with ESMTP; 12 Apr 2018 21:13:55 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,444,1517904000"; d="scan'208";a="31709847" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 12:13:52 +0800 Message-Id: <20180413041352.27740-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [edk2] [PATCH] MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStart X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Steven Shi Cc: Star Zeng Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeMod= ulePkg/Universal/Console/TerminalDxe/Terminal.c index 60de2d4d6d..66dd3ad550 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -2,7 +2,7 @@ Produces Simple Text Input Protocol, Simple Text Input Extended Protocol= and Simple Text Output Protocol upon Serial IO Protocol. =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License which accompanies this distribution. The full text of the license may be = found at @@ -488,6 +488,9 @@ TerminalDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); ASSERT ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STARTE= D)); + if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { + return Status; + } =20 // // Open the Serial I/O Protocol BY_DRIVER. It might already be started. @@ -501,6 +504,9 @@ TerminalDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); ASSERT ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STARTE= D)); + if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { + return Status; + } =20 if (!IsHotPlugDevice (ParentDevicePath)) { // --=20 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel