Hello Patrick Rudolph, build bot (Jenkins), Damien Zammit,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32054
to look at the new patch set (#4).
Change subject: nb/intel/pineview: Correct lsbpos(0) and msbpos(0) ......................................................................
nb/intel/pineview: Correct lsbpos(0) and msbpos(0)
lsbpos and msbpos have incorrect behaviour when given 0. lsbpos(0) returns 8, and msbpos(0) hangs. The latter is because the check i >= 0 is always true for an unsigned integer, causing it to loop indefinitely (this was flagged by Coverity).
0 doesn't have a lsb or msb position, so we change both functions to return -1 in this case to indicate an error. The code already guards against calling these functions with 0, but we make this more explicit to prevent errors in the future.
Found-by: Coverity Scan, CID 1347356, 1347386 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: Ic5be50846cc545dcd48593e5ed3fd6068a6104cb --- M src/northbridge/intel/pineview/raminit.c 1 file changed, 22 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/32054/4