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 <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Hao Wu <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Signed-off-by: Dandan Bi <[email protected]>
---
 .../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.<BR>
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#39396): https://edk2.groups.io/g/devel/message/39396
Mute This Topic: https://groups.io/mt/31306510/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to