From 49b4a8932349e01ed65e2528e82ea0dfa25410e1 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Thu, 2 Mar 2017 13:52:54 +0200 Subject: AGESA: Fix loop condition for eventlog read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not evaluate AmdEventParams if AmdReadEventLog() fails. Change-Id: I2b8afe827ffe6757e64c00ab005d3bb8cc577321 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/18611 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones Reviewed-by: Marshall Dawson Reviewed-by: Philippe Mathieu-Daudé --- src/northbridge/amd/agesa/eventlog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/northbridge/amd/agesa/eventlog.c b/src/northbridge/amd/agesa/eventlog.c index 0a40672960..20944b2f10 100644 --- a/src/northbridge/amd/agesa/eventlog.c +++ b/src/northbridge/amd/agesa/eventlog.c @@ -707,6 +707,7 @@ static void interpret_agesa_eventlog(EVENT_PARAMS *event) static void amd_readeventlog(AMD_CONFIG_PARAMS *StdHeader) { + AGESA_STATUS status; EVENT_PARAMS AmdEventParams; memset(&AmdEventParams, 0, sizeof(EVENT_PARAMS)); @@ -717,8 +718,8 @@ static void amd_readeventlog(AMD_CONFIG_PARAMS *StdHeader) AmdEventParams.StdHeader.ImageBasePtr = 0; AmdEventParams.StdHeader.HeapStatus = StdHeader->HeapStatus; - AmdReadEventLog(&AmdEventParams); - while (AmdEventParams.EventClass != 0) { + status = AmdReadEventLog(&AmdEventParams); + while ((status == AGESA_SUCCESS) && (AmdEventParams.EventClass != 0)) { printk(BIOS_DEBUG,"\nEventLog: EventClass = %x, EventInfo = %x.\n", (unsigned int)AmdEventParams.EventClass, (unsigned int)AmdEventParams.EventInfo); @@ -728,7 +729,7 @@ static void amd_readeventlog(AMD_CONFIG_PARAMS *StdHeader) printk(BIOS_DEBUG," Param3 = %x, Param4 = %x.\n", (unsigned int)AmdEventParams.DataParam3, (unsigned int)AmdEventParams.DataParam4); - AmdReadEventLog(&AmdEventParams); + status = AmdReadEventLog(&AmdEventParams); } } -- cgit v1.2.3