diff options
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c | 14 |
1 files changed, 11 insertions, 3 deletions
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);
}
|