summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Dxe/Image
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-06-09 09:41:02 +0000
committerlzeng14 <lzeng14@Edk2>2015-06-09 09:41:02 +0000
commit57400f34db837a9492f4defc192a178f279f1ba6 (patch)
tree58f358f9bea312620c926cade90f198da44e9532 /MdeModulePkg/Core/Dxe/Image
parenteadbec01094cddc4052e73ea06743d5c6761e9f7 (diff)
downloadedk2-57400f34db837a9492f4defc192a178f279f1ba6.tar.gz
edk2-57400f34db837a9492f4defc192a178f279f1ba6.tar.bz2
edk2-57400f34db837a9492f4defc192a178f279f1ba6.zip
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 <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17597 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Image')
-rw-r--r--MdeModulePkg/Core/Dxe/Image/Image.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c
index 33686a66c4..ea6b2c6a42 100644
--- a/MdeModulePkg/Core/Dxe/Image/Image.c
+++ b/MdeModulePkg/Core/Dxe/Image/Image.c
@@ -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 @@ CoreUnloadAndCloseImage (
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 @@ CoreUnloadImage (
Status = EFI_INVALID_PARAMETER;
goto Done;
}
- UnregisterMemoryProfileImage (Image);
if (Image->Started) {
//