From d492e3ff93c2903560793a1bfdd79dee42dddc1d Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 3 Aug 2016 23:10:36 +0200 Subject: [PATCH] UPSTREAM: vendorcode/amd/pi/Lib: Fix reporting fatal error Instead of writing the first word of 6 "post code structs" where only one exists (leading to 0xDEAD and 5 garbage words), write the correct set. BUG=None BRANCH=None TEST=None Change-Id: Ic0aefaf938f146b2461b99182db421a73743931c Signed-off-by: Patrick Georgi Found-by: Coverity Scan #1361054, #1361055, #1361056 Reviewed-on: https://review.coreboot.org/16058 Tested-by: build bot (Jenkins) Reviewed-by: Kysti Mlkki Reviewed-on: https://chromium-review.googlesource.com/368781 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin --- src/vendorcode/amd/pi/Lib/amdlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendorcode/amd/pi/Lib/amdlib.c b/src/vendorcode/amd/pi/Lib/amdlib.c index 5e85f6b1f8..4c8a56dba8 100644 --- a/src/vendorcode/amd/pi/Lib/amdlib.c +++ b/src/vendorcode/amd/pi/Lib/amdlib.c @@ -1408,7 +1408,7 @@ IdsErrorStop ( while(1) { offset %= sizeof(struct POST) / 2; - WriteIo32(80, *((UINT32*)(&post+offset))); + WriteIo16(80, *((UINT16 *)&post)+offset); ++offset; for (j=0; j<250; ++j) { ReadIo8(80);