From: Star Zeng Date: Tue, 9 Jun 2015 09:42:15 +0000 (+0000) Subject: EdkCompatibilityPkg SmmBaseHelper: Unregister profile image correctly. X-Git-Tag: edk2-stable201903~9663 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=071586ee476b0c1325a008c6535dd4d2064252ab EdkCompatibilityPkg SmmBaseHelper: Unregister profile image correctly. Call UnregisterSmramProfileImage() before image buffer freed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17599 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c index 2b94e4d877..1d1644923d 100644 --- a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c +++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c @@ -11,7 +11,7 @@ SmmHandlerEntry() will receive untrusted input and do validation. - Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
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 @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -734,10 +733,10 @@ LoadImage ( RegisterSmramProfileImage (FilePath, DstBuffer, PageCount); Status = gBS->StartImage (*ImageHandle, NULL, NULL); if (EFI_ERROR (Status)) { + UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount); mLoadPe32Image->UnLoadPeImage (mLoadPe32Image, *ImageHandle); *ImageHandle = NULL; FreePages ((VOID *)(UINTN)DstBuffer, PageCount); - UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount); } } diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c index 84eba482f4..a1797eaa60 100644 --- a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c +++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
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 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include