Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33210
Change subject: nb/amd/amdfam10: Use 64 bits in multiplication ......................................................................
nb/amd/amdfam10: Use 64 bits in multiplication
The literal needs to be cast to a uint64 to prevent num_nodes from being implicitly promoted to a signed int.
Change-Id: Id2fa328fb8d0a9827c7c78157c024736e9b26dc4 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1347343 --- M src/northbridge/amd/amdfam10/northbridge.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/33210/1
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index a681961..17b0512 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -791,7 +791,7 @@
/* Calculate CC6 storage area size */ if (interleaved) - qword = (0x1000000 * num_nodes); + qword = (uint64_t)0x1000000 * num_nodes; else qword = 0x1000000;