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
\r
SmmHandlerEntry() will receive untrusted input and do validation.\r
\r
\r
SmmHandlerEntry() will receive untrusted input and do validation.\r
\r
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2015, 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
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
#include <Library/MemoryAllocationLib.h>\r
#include <Library/SynchronizationLib.h>\r
#include <Library/CpuLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/SynchronizationLib.h>\r
#include <Library/CpuLib.h>\r
-#include <Library/PcdLib.h>\r
#include <Guid/SmmBaseThunkCommunication.h>\r
#include <Protocol/SmmBaseHelperReady.h>\r
#include <Protocol/SmmCpu.h>\r
#include <Guid/SmmBaseThunkCommunication.h>\r
#include <Protocol/SmmBaseHelperReady.h>\r
#include <Protocol/SmmCpu.h>\r
RegisterSmramProfileImage (FilePath, DstBuffer, PageCount);\r
Status = gBS->StartImage (*ImageHandle, NULL, NULL);\r
if (EFI_ERROR (Status)) {\r
RegisterSmramProfileImage (FilePath, DstBuffer, PageCount);\r
Status = gBS->StartImage (*ImageHandle, NULL, NULL);\r
if (EFI_ERROR (Status)) {\r
+ UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount);\r
mLoadPe32Image->UnLoadPeImage (mLoadPe32Image, *ImageHandle);\r
*ImageHandle = NULL;\r
FreePages ((VOID *)(UINTN)DstBuffer, PageCount);\r
mLoadPe32Image->UnLoadPeImage (mLoadPe32Image, *ImageHandle);\r
*ImageHandle = NULL;\r
FreePages ((VOID *)(UINTN)DstBuffer, PageCount);\r
- UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount);\r
- Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2014 - 2015, 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
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
#include <Library/DevicePathLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/DevicePathLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
#include <Protocol/SmmCommunication.h>\r
\r
#include <Guid/MemoryProfile.h>\r
#include <Protocol/SmmCommunication.h>\r
\r
#include <Guid/MemoryProfile.h>\r