MemoryMap = NULL;
MemoryMapSize = 0;
+ Pages = 0;
do {
Status = gBS->GetMemoryMap (
&MemoryMapSize,
&DescriptorSize,
&DescriptorVersion
);
- // Don't do anything between the GetMemoryMap() and ExitBootServices()
- if (!EFI_ERROR (Status)) {
- Status = gBS->ExitBootServices (gImageHandle, MapKey);
- if (EFI_ERROR (Status)) {
- FreePages (MemoryMap, Pages);
- MemoryMap = NULL;
- MemoryMapSize = 0;
- }
+ }
+
+ // Don't do anything between the GetMemoryMap() and ExitBootServices()
+ if (!EFI_ERROR(Status)) {
+ Status = gBS->ExitBootServices (gImageHandle, MapKey);
+ if (EFI_ERROR(Status)) {
+ FreePages (MemoryMap, Pages);
+ MemoryMap = NULL;
+ MemoryMapSize = 0;
}
}
- } while (EFI_ERROR (Status));
+ } while (EFI_ERROR(Status));
return Status;
}