summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-19 04:22:35 +0000
committerjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-19 04:22:35 +0000
commita5ca8fa772e38feed5733fb33e880a129107f578 (patch)
tree12fb920371cd746d7003237502ae7925bb4ff8b5 /MdeModulePkg
parent6c3fa13c9114e39529652a6891c36ab3c8a1d6ca (diff)
downloadedk2-platforms-a5ca8fa772e38feed5733fb33e880a129107f578.tar.xz
Hold Memory Lock until DEBUG_CLEAR_MEMORY called in CoreFreePages().
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10284 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/Page.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c
index f351a121f3..b0cf1ece1e 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Page.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
@@ -1168,8 +1168,8 @@ CoreFreePages (
}
}
if (Link == &gMemoryMap) {
- CoreReleaseMemoryLock ();
- return EFI_NOT_FOUND;
+ Status = EFI_NOT_FOUND;
+ goto Done;
}
Alignment = EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT;
@@ -1185,8 +1185,8 @@ CoreFreePages (
}
if ((Memory & (Alignment - 1)) != 0) {
- CoreReleaseMemoryLock ();
- return EFI_INVALID_PARAMETER;
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
}
NumberOfPages += EFI_SIZE_TO_PAGES (Alignment) - 1;
@@ -1194,10 +1194,8 @@ CoreFreePages (
Status = CoreConvertPages (Memory, NumberOfPages, EfiConventionalMemory);
- CoreReleaseMemoryLock ();
-
if (EFI_ERROR (Status)) {
- return Status;
+ goto Done;
}
//
@@ -1207,6 +1205,8 @@ CoreFreePages (
DEBUG_CLEAR_MEMORY ((VOID *)(UINTN)Memory, NumberOfPages << EFI_PAGE_SHIFT);
}
+Done:
+ CoreReleaseMemoryLock ();
return Status;
}