[coreboot-gerrit] Change in coreboot[master]: Coverity: Fix CID1393976

Philipp Deppenwiese (Code Review) gerrit at coreboot.org
Thu Jul 12 17:22:15 CEST 2018


Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/27447 )

Change subject: Coverity: Fix CID1393976
......................................................................

Coverity: Fix CID1393976

Cast to u64 to prevent possible integer overflow.

Change-Id: I5c7d25278db54523242314cba6c85ac2f7a6c1f3
Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
Reviewed-on: https://review.coreboot.org/27447
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
---
M src/soc/cavium/cn81xx/clock.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  Philipp Deppenwiese: Looks good to me, approved



diff --git a/src/soc/cavium/cn81xx/clock.c b/src/soc/cavium/cn81xx/clock.c
index bd6514c..02f152f 100644
--- a/src/soc/cavium/cn81xx/clock.c
+++ b/src/soc/cavium/cn81xx/clock.c
@@ -63,7 +63,7 @@
 
 	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 @@
 
 	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;
 }

-- 
To view, visit https://review.coreboot.org/27447
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5c7d25278db54523242314cba6c85ac2f7a6c1f3
Gerrit-Change-Number: 27447
Gerrit-PatchSet: 2
Gerrit-Owner: Patrick Rudolph <patrick.rudolph at 9elements.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180712/f887b463/attachment.html>


More information about the coreboot-gerrit mailing list