summaryrefslogtreecommitdiff
path: root/src/northbridge/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-03-02 13:52:54 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-03-09 12:44:56 +0100
commit49b4a8932349e01ed65e2528e82ea0dfa25410e1 (patch)
tree917e8be870a7587046002893e0a2eb77fa72eefb /src/northbridge/amd
parent4f74c895929594598c323e026b27772f22d68eaa (diff)
downloadcoreboot-49b4a8932349e01ed65e2528e82ea0dfa25410e1.tar.xz
AGESA: Fix loop condition for eventlog read
Do not evaluate AmdEventParams if AmdReadEventLog() fails. Change-Id: I2b8afe827ffe6757e64c00ab005d3bb8cc577321 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/18611 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc@marcjonesconsulting.com> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r--src/northbridge/amd/agesa/eventlog.c7
1 files changed, 4 insertions, 3 deletions
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);
}
}