From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: dandan.bi@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Tue, 23 Apr 2019 00:00:55 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 00:00:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,384,1549958400"; d="scan'208";a="225843159" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.147]) by orsmga001.jf.intel.com with ESMTP; 23 Apr 2019 00:00:53 -0700 From: "Dandan Bi" To: devel@edk2.groups.io Cc: Liming Gao , Eric Dong , Hao Wu , Ruiyu Ni Subject: [patch 1/2] MdeModulePkg/BMMUiLib: Set Handle to NULL after uninstall protocol Date: Tue, 23 Apr 2019 15:00:38 +0800 Message-Id: <20190423070039.29160-2-dandan.bi@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20190423070039.29160-1-dandan.bi@intel.com> References: <20190423070039.29160-1-dandan.bi@intel.com> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1728 Currently Emulator meets ASSERT when enter setup->Continue->enter setup. When re-enter setup, the BmmDriverHandle in BMMUiLib Constructor is not NULL which cause InstallMultipleProtocolInterfaces failure, then ASSERT. So here set BmmDriverHandle to NULL after uninstalling protocols on it in Destructor function to avoid this issue. Cc: Liming Gao Cc: Eric Dong Cc: Hao Wu Cc: Ruiyu Ni Signed-off-by: Dandan Bi --- .../Library/BootMaintenanceManagerUiLib/BootMaintenance.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index 2167d3a5e8..28592f9f47 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -1,9 +1,9 @@ /** @file The functions for Boot Maintainence Main menu. -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "BootMaintenanceManager.h" @@ -1761,9 +1761,10 @@ BootMaintenanceManagerUiLibDestructor ( &mBmmCallbackInfo->BmmConfigAccess, NULL ); FreePool (mBmmCallbackInfo->LoadContext); + mBmmCallbackInfo->BmmDriverHandle = NULL; return EFI_SUCCESS; } -- 2.18.0.windows.1