From 4376a6f27300b7f710947ccf5df53f45a556d970 Mon Sep 17 00:00:00 2001 From: rsun3 Date: Wed, 8 Apr 2009 09:20:51 +0000 Subject: [PATCH] Fix the bug that Boot Mainteinance Manager in the front page can not be entered twice or more. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8040 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/BdsDxe/BootMaint/BootMaint.c | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c index f5e0bf04a0..98aadd6ce1 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c @@ -910,7 +910,7 @@ InitializeBM ( NULL ); if (EFI_ERROR (Status)) { - return Status; + goto Exit; } // @@ -925,7 +925,7 @@ InitializeBM ( NULL ); if (EFI_ERROR (Status)) { - return Status; + goto Exit; } // @@ -962,9 +962,8 @@ InitializeBM ( gUpdateData.BufferSize = UPDATE_DATA_SIZE; gUpdateData.Data = AllocateZeroPool (UPDATE_DATA_SIZE); if (gUpdateData.Data == NULL) { - FreePool (BmmCallbackInfo->LoadContext); - FreePool (BmmCallbackInfo); - return EFI_OUT_OF_RESOURCES; + Status = EFI_OUT_OF_RESOURCES; + goto Exit; } InitializeStringDepository (); @@ -1065,11 +1064,35 @@ InitializeBM ( FreeAllMenu (); - FreePool (BmmCallbackInfo->LoadContext); - FreePool (BmmCallbackInfo); FreePool (gUpdateData.Data); gUpdateData.Data = NULL; +Exit: + if (BmmCallbackInfo->FeDriverHandle != NULL) { + gBS->UninstallMultipleProtocolInterfaces ( + BmmCallbackInfo->FeDriverHandle, + &gEfiDevicePathProtocolGuid, + &mFeHiiVendorDevicePath, + &gEfiHiiConfigAccessProtocolGuid, + &BmmCallbackInfo->FeConfigAccess, + NULL + ); + } + + if (BmmCallbackInfo->BmmDriverHandle != NULL) { + gBS->UninstallMultipleProtocolInterfaces ( + BmmCallbackInfo->BmmDriverHandle, + &gEfiDevicePathProtocolGuid, + &mBmmHiiVendorDevicePath, + &gEfiHiiConfigAccessProtocolGuid, + &BmmCallbackInfo->BmmConfigAccess, + NULL + ); + } + + FreePool (BmmCallbackInfo->LoadContext); + FreePool (BmmCallbackInfo); + return Status; } -- 2.39.2