From 1d1a68b754e57d2dd5454c426831927dc1c3ead4 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Wed, 24 Oct 2012 11:13:47 +0800 Subject: Trinity: Initialize the pointer prior to using it Change-Id: I2f10909a626fb64c7f95663ddd79a3b899f73bc4 Signed-off-by: Zheng Bao Signed-off-by: Zheng Bao Reviewed-on: http://review.coreboot.org/1606 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin Reviewed-by: Marc Jones --- src/mainboard/amd/parmer/BiosCallOuts.c | 4 ++-- src/mainboard/amd/thatcher/BiosCallOuts.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mainboard') diff --git a/src/mainboard/amd/parmer/BiosCallOuts.c b/src/mainboard/amd/parmer/BiosCallOuts.c index a5e274ae22..24268d7345 100644 --- a/src/mainboard/amd/parmer/BiosCallOuts.c +++ b/src/mainboard/amd/parmer/BiosCallOuts.c @@ -297,11 +297,11 @@ AGESA_STATUS BiosDeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr) BIOS_HEAP_MANAGER *BiosHeapBasePtr; AGESA_BUFFER_PARAMS *AllocParams; + AllocParams = (AGESA_BUFFER_PARAMS *) ConfigPtr; + BiosHeapBaseAddr = (UINT8 *) GetHeapBase(&(AllocParams->StdHeader)); BiosHeapBasePtr = (BIOS_HEAP_MANAGER *) BiosHeapBaseAddr; - AllocParams = (AGESA_BUFFER_PARAMS *) ConfigPtr; - /* Find target node to deallocate in list of allocated nodes. Return AGESA_BOUNDS_CHK if the BufferHandle is not found */ diff --git a/src/mainboard/amd/thatcher/BiosCallOuts.c b/src/mainboard/amd/thatcher/BiosCallOuts.c index 8660e05410..d4da61aa79 100644 --- a/src/mainboard/amd/thatcher/BiosCallOuts.c +++ b/src/mainboard/amd/thatcher/BiosCallOuts.c @@ -297,11 +297,11 @@ AGESA_STATUS BiosDeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr) BIOS_HEAP_MANAGER *BiosHeapBasePtr; AGESA_BUFFER_PARAMS *AllocParams; + AllocParams = (AGESA_BUFFER_PARAMS *) ConfigPtr; + BiosHeapBaseAddr = (UINT8 *) GetHeapBase(&(AllocParams->StdHeader)); BiosHeapBasePtr = (BIOS_HEAP_MANAGER *) BiosHeapBaseAddr; - AllocParams = (AGESA_BUFFER_PARAMS *) ConfigPtr; - /* Find target node to deallocate in list of allocated nodes. Return AGESA_BOUNDS_CHK if the BufferHandle is not found */ -- cgit v1.2.3