From e0c181d48790be12b469b175bf4d9931a8c79fa1 Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Mon, 8 Apr 2019 22:21:43 -0600 Subject: nb/intel/sandybridge: Set uninitialized run length If the entire array is zero, then the length of the longest zero run is the length of the array itself. Found-by: Coverity Scan, CID 1229715 Signed-off-by: Jacob Garber Change-Id: Id23292087b14182448d70117915fb044e9c579f7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/32249 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph Reviewed-by: Paul Menzel --- src/northbridge/intel/sandybridge/raminit_common.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/northbridge/intel/sandybridge/raminit_common.c') diff --git a/src/northbridge/intel/sandybridge/raminit_common.c b/src/northbridge/intel/sandybridge/raminit_common.c index 55df03b8d2..cbbd2317ed 100644 --- a/src/northbridge/intel/sandybridge/raminit_common.c +++ b/src/northbridge/intel/sandybridge/raminit_common.c @@ -1142,6 +1142,7 @@ static struct run get_longest_zero_run(int *seq, int sz) ret.middle = sz / 2; ret.start = 0; ret.end = sz; + ret.length = sz; ret.all = 1; return ret; } -- cgit v1.2.3