From 2f2e113f6077b57c20d482fafaac1b3331ad9f8d Mon Sep 17 00:00:00 2001 From: Joe Moore Date: Wed, 16 Oct 2019 05:27:41 -0600 Subject: vc/amd/agesa/f16kb: Cast to UINT64 to avoid overflow Evaluated using 32-bit arithmetic, then used in a context that expects an expression of type UINT64. Cast to UINT64 instead. Change-Id: I4f0aa26e116b47505633897c790ca8e86ea5dc4e Signed-off-by: Joe Moore Found-by: Coverity CID 1241847 Reviewed-on: https://review.coreboot.org/c/coreboot/+/36081 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vendorcode/amd') diff --git a/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c b/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c index 856a21af33..2f919d76e2 100644 --- a/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c +++ b/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c @@ -716,7 +716,7 @@ MemFGetDctInterleavedLimit ( UINT8 i; DctMemLimit = 0; - if (DctInterleavedMemSize == NBPtr->DCTPtr->Timings.DctMemSize << 6) { + if (DctInterleavedMemSize == (UINT64)(NBPtr->DCTPtr->Timings.DctMemSize) << 6) { // The whole memory range is interleaved for the DCTs with the minimum memory size for (i = 0; i < NBPtr->DctCount; i++) { DctMemLimit += DctInterleavedMemSize; -- cgit v1.2.3