From 09c31d557fb731cac17821e547cdb644ee817463 Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Tue, 4 Jun 2019 10:30:41 -0600 Subject: 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 Found-by: Coverity CID 1347343 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33210 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: HAOUAS Elyes --- src/northbridge/amd/amdfam10/northbridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index 0c594b9f62..e28b89b8e4 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -779,7 +779,7 @@ static void amdfam10_domain_read_resources(struct device *dev) /* Calculate CC6 storage area size */ if (interleaved) - qword = (0x1000000 * num_nodes); + qword = (uint64_t)0x1000000 * num_nodes; else qword = 0x1000000; -- cgit v1.2.3