mirror of
				https://github.com/acidanthera/audk.git
				synced 2025-10-31 03:03:46 +01:00 
			
		
		
		
	ArmPkg,ArmPlatformPkg: Free memory allocated by Get.*SpaceMap()
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14507 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		
							parent
							
								
									6ea162c214
								
							
						
					
					
						commit
						5b53eaffe8
					
				| @ -15,6 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |||||||
| 
 | 
 | ||||||
| --*/ | --*/ | ||||||
| 
 | 
 | ||||||
|  | #include <Library/MemoryAllocationLib.h> | ||||||
| #include "CpuDxe.h" | #include "CpuDxe.h" | ||||||
| 
 | 
 | ||||||
| #define TT_ATTR_INDX_INVALID    ((UINT32)~0) | #define TT_ATTR_INDX_INVALID    ((UINT32)~0) | ||||||
| @ -122,6 +123,8 @@ GetNextEntryAttribute ( | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   FreePool (MemorySpaceMap); | ||||||
|  | 
 | ||||||
|   return BaseAddress + (EntryCount * TT_ADDRESS_AT_LEVEL(TableLevel)); |   return BaseAddress + (EntryCount * TT_ADDRESS_AT_LEVEL(TableLevel)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -185,5 +188,7 @@ SyncCacheConfig ( | |||||||
|       EndAddressGcdRegion - BaseAddressGcdRegion, |       EndAddressGcdRegion - BaseAddressGcdRegion, | ||||||
|       PageAttributeToGcdAttribute (PageAttribute)); |       PageAttributeToGcdAttribute (PageAttribute)); | ||||||
| 
 | 
 | ||||||
|  |   FreePool (MemorySpaceMap); | ||||||
|  | 
 | ||||||
|   return EFI_SUCCESS; |   return EFI_SUCCESS; | ||||||
| } | } | ||||||
|  | |||||||
| @ -2,18 +2,20 @@ | |||||||
| 
 | 
 | ||||||
| Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR> | Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR> | ||||||
| Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR> | Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR> | ||||||
|  | Portions copyright (c) 2013, ARM Ltd. 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 | ||||||
| http://opensource.org/licenses/bsd-license.php                                            
 | http://opensource.org/licenses/bsd-license.php
 | ||||||
|                                                                                            | 
 | ||||||
| THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                      | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | ||||||
| WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.              | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| --*/ | --*/ | ||||||
| 
 | 
 | ||||||
|  | #include <Library/MemoryAllocationLib.h> | ||||||
| #include "CpuDxe.h" | #include "CpuDxe.h" | ||||||
| 
 | 
 | ||||||
| // First Level Descriptors
 | // First Level Descriptors
 | ||||||
| @ -330,6 +332,8 @@ SyncCacheConfig ( | |||||||
|     SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes); |     SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   FreePool (MemorySpaceMap); | ||||||
|  | 
 | ||||||
|   return EFI_SUCCESS; |   return EFI_SUCCESS; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -337,6 +337,8 @@ EblDumpGcd ( | |||||||
|     AsciiPrint ("\n"); |     AsciiPrint ("\n"); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   FreePool (MemorySpaceMap); | ||||||
|  | 
 | ||||||
|   Status = gDS->GetIoSpaceMap(&NumberOfDescriptors,&IoSpaceMap); |   Status = gDS->GetIoSpaceMap(&NumberOfDescriptors,&IoSpaceMap); | ||||||
|   if (EFI_ERROR (Status)) { |   if (EFI_ERROR (Status)) { | ||||||
|       return Status; |       return Status; | ||||||
| @ -355,6 +357,8 @@ EblDumpGcd ( | |||||||
|     AsciiPrint ("\n"); |     AsciiPrint ("\n"); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   FreePool (IoSpaceMap); | ||||||
|  | 
 | ||||||
|   return EFI_SUCCESS; |   return EFI_SUCCESS; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user