mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
ArmPkg/BdsLib: Fixed ShutdownUefiBootServices() in case the first gBS->GetMemoryMap() was successful
If the first call of gBS->GetMemoryMap() succeeded (could happen if the Memory Map has changed between the two gBS->GetMemoryMap() calls) in the loop block then gBS->ExitBootServices() was never called. Signed-off-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13500 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
8cfd2e2457
commit
7422411e38
@ -43,6 +43,7 @@ ShutdownUefiBootServices (
|
|||||||
|
|
||||||
MemoryMap = NULL;
|
MemoryMap = NULL;
|
||||||
MemoryMapSize = 0;
|
MemoryMapSize = 0;
|
||||||
|
Pages = 0;
|
||||||
do {
|
do {
|
||||||
Status = gBS->GetMemoryMap (
|
Status = gBS->GetMemoryMap (
|
||||||
&MemoryMapSize,
|
&MemoryMapSize,
|
||||||
@ -66,17 +67,18 @@ ShutdownUefiBootServices (
|
|||||||
&DescriptorSize,
|
&DescriptorSize,
|
||||||
&DescriptorVersion
|
&DescriptorVersion
|
||||||
);
|
);
|
||||||
// Don't do anything between the GetMemoryMap() and ExitBootServices()
|
}
|
||||||
if (!EFI_ERROR (Status)) {
|
|
||||||
Status = gBS->ExitBootServices (gImageHandle, MapKey);
|
// Don't do anything between the GetMemoryMap() and ExitBootServices()
|
||||||
if (EFI_ERROR (Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
FreePages (MemoryMap, Pages);
|
Status = gBS->ExitBootServices (gImageHandle, MapKey);
|
||||||
MemoryMap = NULL;
|
if (EFI_ERROR(Status)) {
|
||||||
MemoryMapSize = 0;
|
FreePages (MemoryMap, Pages);
|
||||||
}
|
MemoryMap = NULL;
|
||||||
|
MemoryMapSize = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (EFI_ERROR (Status));
|
} while (EFI_ERROR(Status));
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user