From ded0c77d4820213a1c0def799e6ae95ba84cc605 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 11 Jul 2018 13:57:41 +0200 Subject: Coverity: Fix CID1393976 Cast to u64 to prevent possible integer overflow. Change-Id: I5c7d25278db54523242314cba6c85ac2f7a6c1f3 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/27447 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese --- src/soc/cavium/cn81xx/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/soc/cavium/cn81xx/clock.c b/src/soc/cavium/cn81xx/clock.c index bd6514cd41..02f152f223 100644 --- a/src/soc/cavium/cn81xx/clock.c +++ b/src/soc/cavium/cn81xx/clock.c @@ -63,7 +63,7 @@ u64 thunderx_get_io_clock(void) rst_boot.u = read64((void *)RST_PF_BAR0); - return rst_boot.s.pnr_mul * PLL_REF_CLK; + return ((u64)rst_boot.s.pnr_mul) * PLL_REF_CLK; } /** @@ -75,5 +75,5 @@ u64 thunderx_get_core_clock(void) rst_boot.u = read64((void *)RST_PF_BAR0); - return rst_boot.s.c_mul * PLL_REF_CLK; + return ((u64)rst_boot.s.c_mul) * PLL_REF_CLK; } -- cgit v1.2.3