From 116b142d869c1a37893ab435045e38a7881dd18d Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 28 Jul 2010 01:43:18 +0000 Subject: Roll back change r10695, because new update on r10700 and r10701 handles this issue. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10704 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/DxeServicesLib/DxeServicesLib.c | 38 ++-------------------- .../PciSegmentLib.c | 6 +--- 2 files changed, 4 insertions(+), 40 deletions(-) (limited to 'MdePkg') diff --git a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c index 9cf845d..d8e6b5c 100644 --- a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c +++ b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c @@ -122,7 +122,6 @@ InternalGetSectionFromFv ( EFI_STATUS Status; EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; UINT32 AuthenticationStatus; - VOID* TempBuffer; ASSERT (NameGuid != NULL); ASSERT (Buffer != NULL); @@ -171,17 +170,6 @@ InternalGetSectionFromFv ( ); } - if (!EFI_ERROR (Status)) { - // - // The found buffer by FV protocol is allocated by gBS AllocatePool() service. - // Copy the found buffer to the allocated buffer by AllocatePool(). - // So, the returned buffer can be freed by FreePool(). - // - TempBuffer = AllocateCopyPool (*Size, *Buffer); - gBS->FreePool (*Buffer); - *Buffer = TempBuffer; - } - return Status; } @@ -324,11 +312,7 @@ GetSectionFromAnyFvByFileType ( Done: if (HandleBuffer != NULL) { - // - // HandleBuffer is allocated by gBS AllocatePool() service. - // So, gBS FreePool() service is used to free HandleBuffer. - // - gBS->FreePool (HandleBuffer); + FreePool(HandleBuffer); } return Status; @@ -451,12 +435,8 @@ GetSectionFromAnyFv ( Done: - if (HandleBuffer != NULL) { - // - // HandleBuffer is allocated by gBS AllocatePool() service. - // So, gBS FreePool() service is used to free HandleBuffer. - // - gBS->FreePool (HandleBuffer); + if (HandleBuffer != NULL) { + FreePool(HandleBuffer); } return Status; @@ -635,7 +615,6 @@ GetFileBufferByFilePath ( EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol; EFI_SECTION_TYPE SectionType; UINT8 *ImageBuffer; - UINT8 *TempBuffer; UINTN ImageBufferSize; EFI_FV_FILETYPE Type; EFI_FV_FILE_ATTRIBUTES Attrib; @@ -663,7 +642,6 @@ GetFileBufferByFilePath ( FileInfo = NULL; FileHandle = NULL; ImageBuffer = NULL; - TempBuffer = NULL; ImageBufferSize = 0; *AuthenticationStatus = 0; @@ -724,16 +702,6 @@ GetFileBufferByFilePath ( AuthenticationStatus ); } - if (!EFI_ERROR (Status)) { - // - // The found buffer by FV protocol is allocated by gBS AllocatePool() service. - // Copy the found buffer to the allocated buffer by AllocatePool(). - // Then, this returned buffer can be freed by FreePool(). - // - TempBuffer = AllocateCopyPool (ImageBufferSize, ImageBuffer); - gBS->FreePool (ImageBuffer); - ImageBuffer = TempBuffer; - } } } goto Finish; diff --git a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c index d6527ef..ccd9df3 100644 --- a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c +++ b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c @@ -96,11 +96,7 @@ PciSegmentLibConstructor ( ASSERT (Descriptors->Desc != ACPI_END_TAG_DESCRIPTOR); } - // - // HandleBuffer is allocated by gBS AllocatePool() service. - // So, gBS FreePool() service is used to free HandleBuffer. - // - gBS->FreePool (HandleBuffer); + FreePool(HandleBuffer); return EFI_SUCCESS; } -- cgit v1.1