Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33409
Change subject: nb/intel/x4x: Die on unknown memory speed ......................................................................
nb/intel/x4x: Die on unknown memory speed
The speed argument should be one of the six values from the mem_clk enum, so something is very wrong if this is not the case. Better to die() now than return 0, which will cause a division-by-zero error later on where this function is called.
Change-Id: Ib628c0eed3d6571bdde1df27ae213ca0691ec256 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1391088 --- M src/northbridge/intel/x4x/raminit_ddr23.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/33409/1
diff --git a/src/northbridge/intel/x4x/raminit_ddr23.c b/src/northbridge/intel/x4x/raminit_ddr23.c index 422b0ff..dae10cf 100644 --- a/src/northbridge/intel/x4x/raminit_ddr23.c +++ b/src/northbridge/intel/x4x/raminit_ddr23.c @@ -42,7 +42,7 @@ static const u16 mhz[] = { 0, 0, 667, 800, 1067, 1333 };
if (speed >= ARRAY_SIZE(mhz)) - return 0; + die("RAM init: unknown DDR2 speed %u\n", speed);
return mhz[speed]; }