EdkCompatibilityPkg SmmBaseHelper: Unregister profile image correctly.
Call UnregisterSmramProfileImage() before image buffer freed. 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@17599 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
63aa86b070
commit
071586ee47
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
SmmHandlerEntry() will receive untrusted input and do validation.
|
SmmHandlerEntry() will receive untrusted input and do validation.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -34,7 +34,6 @@
|
||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
#include <Library/SynchronizationLib.h>
|
#include <Library/SynchronizationLib.h>
|
||||||
#include <Library/CpuLib.h>
|
#include <Library/CpuLib.h>
|
||||||
#include <Library/PcdLib.h>
|
|
||||||
#include <Guid/SmmBaseThunkCommunication.h>
|
#include <Guid/SmmBaseThunkCommunication.h>
|
||||||
#include <Protocol/SmmBaseHelperReady.h>
|
#include <Protocol/SmmBaseHelperReady.h>
|
||||||
#include <Protocol/SmmCpu.h>
|
#include <Protocol/SmmCpu.h>
|
||||||
|
@ -734,10 +733,10 @@ LoadImage (
|
||||||
RegisterSmramProfileImage (FilePath, DstBuffer, PageCount);
|
RegisterSmramProfileImage (FilePath, DstBuffer, PageCount);
|
||||||
Status = gBS->StartImage (*ImageHandle, NULL, NULL);
|
Status = gBS->StartImage (*ImageHandle, NULL, NULL);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount);
|
||||||
mLoadPe32Image->UnLoadPeImage (mLoadPe32Image, *ImageHandle);
|
mLoadPe32Image->UnLoadPeImage (mLoadPe32Image, *ImageHandle);
|
||||||
*ImageHandle = NULL;
|
*ImageHandle = NULL;
|
||||||
FreePages ((VOID *)(UINTN)DstBuffer, PageCount);
|
FreePages ((VOID *)(UINTN)DstBuffer, PageCount);
|
||||||
UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
#include <Library/DevicePathLib.h>
|
#include <Library/DevicePathLib.h>
|
||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
#include <Protocol/SmmCommunication.h>
|
#include <Protocol/SmmCommunication.h>
|
||||||
|
|
||||||
#include <Guid/MemoryProfile.h>
|
#include <Guid/MemoryProfile.h>
|
||||||
|
|
Loading…
Reference in New Issue