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 <jgarber1@ualberta.ca>
Change-Id: Id23292087b14182448d70117915fb044e9c579f7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32249
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Jacob Garber 2019-04-08 22:21:43 -06:00 committed by Patrick Georgi
parent cc86d8921b
commit e0c181d487
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}