From a5ca8fa772e38feed5733fb33e880a129107f578 Mon Sep 17 00:00:00 2001 From: jgong5 Date: Fri, 19 Mar 2010 04:22:35 +0000 Subject: 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 --- MdeModulePkg/Core/Dxe/Mem/Page.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'MdeModulePkg/Core/Dxe') 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; } -- cgit v1.2.3