[coreboot-gerrit] Patch set updated for coreboot: AGESA: Fix loop condition for eventlog read

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Wed Mar 8 06:42:50 CET 2017


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18611

-gerrit

commit 31def24acaf64b31a57df37a71682baceb19e700
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Thu Mar 2 13:52:54 2017 +0200

    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 at gmail.com>
---
 src/northbridge/amd/agesa/eventlog.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/northbridge/amd/agesa/eventlog.c b/src/northbridge/amd/agesa/eventlog.c
index 0a40672..20944b2 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);
 	}
 }
 



More information about the coreboot-gerrit mailing list