Revision: 17597
          http://sourceforge.net/p/edk2/code/17597
Author:   lzeng14
Date:     2015-06-09 09:41:02 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
MdeModulePkg DxeCore: Call UnregisterMemoryProfileImage correctly.

Use if (Image->Started) condition judgement before call to
UnregisterMemoryProfileImage() in CoreUnloadAndCloseImage().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Core/Dxe/Image/Image.c

Modified: trunk/edk2/MdeModulePkg/Core/Dxe/Image/Image.c
===================================================================
--- trunk/edk2/MdeModulePkg/Core/Dxe/Image/Image.c      2015-06-09 09:28:06 UTC 
(rev 17596)
+++ trunk/edk2/MdeModulePkg/Core/Dxe/Image/Image.c      2015-06-09 09:41:02 UTC 
(rev 17597)
@@ -1,7 +1,7 @@
 /** @file
   Core image handling services to load and unload PeImage.
 
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -858,6 +858,10 @@
   HandleBuffer = NULL;
   ProtocolGuidArray = NULL;
 
+  if (Image->Started) {
+    UnregisterMemoryProfileImage (Image);
+  }
+
   if (Image->Ebc != NULL) {
     //
     // If EBC protocol exists we must perform cleanups for this image.
@@ -1854,7 +1858,6 @@
     Status = EFI_INVALID_PARAMETER;
     goto Done;
   }
-  UnregisterMemoryProfileImage (Image);
 
   if (Image->Started) {
     //


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to