From nobody Mon Feb 9 02:28:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44435+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44435+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564110672; cv=none; d=zoho.com; s=zohoarc; b=CkCS59mWfhiyGHak8oj4KY9h7QCPCQDPYcAKX1Y4sXsjbjFIywgZeNZD3+v3/TXf8ZhzrFm0V/Cc9Ghd6XfBaF6EcVxtMlJgxcZkHe0aoDRbXgGge54l+VRMs8FNEMM2ekwfPudI1eOcAS3LKTOLS9r/fQnY3q0m+t1gHpgyYEU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564110672; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=AN89zjLHNkQqn+8RFJjyFZKagqujV2UOy2NlDhzveuY=; b=SlsMidjJvtfdj5IvxiWbd/s0mPlLujK5x/gXEzrb3jeyTVheffnV1mUHl99FZ290L7xIN4F/tPhQ1DTSALxT955fWM0NSpsiRVo4UjshLm/iOIQjL7DeGqxup6oX/LTLIg+w8gkCNzlu6drSp1SK/r0M6dcMVA42DmstpAekBwA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44435+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1564110672000718.9303375807675; Thu, 25 Jul 2019 20:11:12 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Thu, 25 Jul 2019 20:11:10 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 20:11:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,309,1559545200"; d="scan'208";a="170497795" X-Received: from shwdeopenpsi174.ccr.corp.intel.com ([10.239.157.39]) by fmsmga008.fm.intel.com with ESMTP; 25 Jul 2019 20:11:09 -0700 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao Subject: [edk2-devel][Patch 3/3] MdePkg/UefiDebugLibStdErr: Add destructor to CloseEvent Date: Fri, 26 Jul 2019 11:10:55 +0800 Message-Id: <20190726031055.10020-4-wei6.xu@intel.com> In-Reply-To: <20190726031055.10020-1-wei6.xu@intel.com> References: <20190726031055.10020-1-wei6.xu@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wei6.xu@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1564110671; bh=etpfdE9zgd7IM3td0a0FZGbrT4LW70tiYjConxCbI2g=; h=Cc:Date:From:Reply-To:Subject:To; b=K+tVGVQbvsKHIebrUFnk5o9hxctJye3YdM/ayuT2PNUMouDcaYrvOjEaVeemjVULMmt PVDZb/YTwvO3PvT33EeMnI6flTwKrHUePslD8N8k0GvE6jPjjJ0dYtrR908Zi4suISkns HSj5GZc13Om8skL8/+yTPgN3wosuS25e+oA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2012 When driver is unloaded, the ExitBootSerivesEvent must be closed at the same time. Otherwise exception will occur when ExitBootServices. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Wei6 Xu --- .../UefiDebugLibStdErr/DebugLibConstructor.c | 23 ++++++++++++++++++= ++++ .../UefiDebugLibStdErr/UefiDebugLibStdErr.inf | 1 + 2 files changed, 24 insertions(+) diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c b/MdeP= kg/Library/UefiDebugLibStdErr/DebugLibConstructor.c index 8005370372..ed73f92818 100644 --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c @@ -73,5 +73,28 @@ DxeDebugLibConstructor( &mExitBootServicesEvent ); =20 return EFI_SUCCESS; } + +/** + The destructor closes Exit Boot Services Event. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The destructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +DxeDebugLibDestructor( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + if (mExitBootServicesEvent !=3D NULL) { + SystemTable->BootServices->CloseEvent (mExitBootServicesEvent); + } + + return EFI_SUCCESS; +} diff --git a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf b/Mde= Pkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf index deaa3427f6..11f7594626 100644 --- a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf +++ b/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf @@ -20,10 +20,11 @@ MODULE_TYPE =3D UEFI_DRIVER VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D DebugLib|DXE_CORE DXE_DRIVER DXE_RUNT= IME_DRIVER UEFI_APPLICATION UEFI_DRIVER =20 CONSTRUCTOR =3D DxeDebugLibConstructor + DESTRUCTOR =3D DxeDebugLibDestructor =20 # # VALID_ARCHITECTURES =3D IA32 X64 EBC # =20 --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44435): https://edk2.groups.io/g/devel/message/44435 Mute This Topic: https://groups.io/mt/32605741/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-