[coreboot-gerrit] New patch to review for coreboot: northbridge/amd/amdmct: Fix array indexing

Jonathan Neuschäfer (j.neuschaefer@gmx.net) gerrit at coreboot.org
Wed Jul 6 22:09:44 CEST 2016


Jonathan Neuschäfer (j.neuschaefer at gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15553

-gerrit

commit 192628c42c7c1098dcaf75f030a7869e16c922fd
Author: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Date:   Wed Jul 6 22:08:46 2016 +0200

    northbridge/amd/amdmct: Fix array indexing
    
    CH_D_BC_RCVRDLY is an array with dimensions [2][4]. The intention of the
    patched line was probably to point just behind the CH_D_BC_RCVRDLY field
    in struct DCTStatStruc, but this is achieved by using index [1][4] or
    [2][0].
    
    Change-Id: Ia5da83cc369ca85ffc507a56a535698cbfa6bc39
    Reported-By: GCC 6.1.0
    Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
---
 src/northbridge/amd/amdmct/mct/mct_d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/northbridge/amd/amdmct/mct/mct_d.c b/src/northbridge/amd/amdmct/mct/mct_d.c
index 0e59e1d..c3b4589 100644
--- a/src/northbridge/amd/amdmct/mct/mct_d.c
+++ b/src/northbridge/amd/amdmct/mct/mct_d.c
@@ -3633,7 +3633,7 @@ static void mct_ResetDataStruct_D(struct MCTStatStruc *pMCTstat,
 			p[i] = 0;
 		}
 
-		start = (u32)(&((struct DCTStatStruc *)0)->CH_D_BC_RCVRDLY[2][4]);
+		start = (u32)(&((struct DCTStatStruc *)0)->CH_D_BC_RCVRDLY[1][4]);
 		stop = sizeof(struct DCTStatStruc);
 		for (i = start; i < stop; i++) {
 			p[i] = 0;



More information about the coreboot-gerrit mailing list