Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32291
Change subject: nb/via/vx900: Use 64 bits to prevent overflow ......................................................................
nb/via/vx900: Use 64 bits to prevent overflow
The bit operations are currently done using 32 bit math. Cast the first argument to 64 bits to prevent possible overflow.
Found-by: Coverity Scan, CID 1229665, 1229666 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: Idd180f31e8cff797a6499b12bc685daa993aae05 --- M src/northbridge/via/vx900/northbridge.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/32291/1
diff --git a/src/northbridge/via/vx900/northbridge.c b/src/northbridge/via/vx900/northbridge.c index d865f38..dcb7fd5 100644 --- a/src/northbridge/via/vx900/northbridge.c +++ b/src/northbridge/via/vx900/northbridge.c @@ -266,8 +266,8 @@ * to be always mapped to the top of 1M, but this can be overcome with * some smart positive/subtractive resource decoding */ ram_resource(dev, idx++, 768, (tolmk - 768)); - uma_memory_size = fbufk << 10; - uma_memory_base = tolmk << 10; + uma_memory_size = (uint64_t)fbufk << 10; + uma_memory_base = (uint64_t)tolmk << 10;
//uma_resource(dev, idx++, uma_memory_base>>10, uma_memory_size>>10);