]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Mem/Page.c
Make sure the return value of MapKey is correct by moving the assignment into memory...
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Mem / Page.c
index 5c82d3178a9209cda18a87da22ef2e21011e0cd0..e415a896cd974cfcbece7cdf22a2e0768105daae 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Memory page management functions.\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1516,11 +1516,6 @@ CoreGetMemoryMap (
   Status = EFI_SUCCESS;\r
 \r
 Done:\r
-\r
-  CoreReleaseMemoryLock ();\r
-\r
-  CoreReleaseGcdMemoryLock ();\r
-\r
   //\r
   // Update the map key finally\r
   //\r
@@ -1528,6 +1523,10 @@ Done:
     *MapKey = mMemoryMapKey;\r
   }\r
 \r
+  CoreReleaseMemoryLock ();\r
+\r
+  CoreReleaseGcdMemoryLock ();\r
+\r
   *MemoryMapSize = BufferSize;\r
 \r
   return Status;\r