From: lgao4 Date: Wed, 22 Apr 2009 03:19:42 +0000 (+0000) Subject: Fix that the variable can't be stored. Next, I will update GetBrowserData API. X-Git-Tag: edk2-stable201903~18119 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e97e2b7738e6bf739794b0df3506aabc98822570;hp=0a1147ed7a578b8dcc4552d4da3efb9a48cea812 Fix that the variable can't be stored. Next, I will update GetBrowserData API. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8147 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c index 982db88dbf..1e8e593059 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c @@ -272,8 +272,16 @@ BootMaintCallback ( // Retrive uncommitted data from Form Browser // CurrentFakeNVMap = (BMM_FAKE_NV_DATA *) HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA)); - if (CurrentFakeNVMap == NULL) { - return EFI_NOT_FOUND; + DisMap = (UINT8 *) CurrentFakeNVMap; + for (Index = 0; Index < sizeof (BMM_FAKE_NV_DATA); Index ++) { + if (DisMap [Index] != 0) { + break; + } + } + + if (Index == sizeof (BMM_FAKE_NV_DATA)) { + FreePool (CurrentFakeNVMap); + CurrentFakeNVMap = &Private->BmmFakeNvData; } // @@ -590,7 +598,7 @@ BootMaintCallback ( // // Update local settting. // - if (CurrentFakeNVMap != NULL) { + if (CurrentFakeNVMap != &Private->BmmFakeNvData) { CopyMem (&Private->BmmFakeNvData, CurrentFakeNVMap, sizeof (BMM_FAKE_NV_DATA)); FreePool (CurrentFakeNVMap); }