[rtems commit] bsps/powerpc: Fix potential integer overflow

Sebastian Huber sebh at rtems.org
Fri May 29 07:00:36 UTC 2015


Module:    rtems
Branch:    master
Commit:    aff220db7a20b58014044848cbd1c37a226e635e
Changeset: http://git.rtems.org/rtems/commit/?id=aff220db7a20b58014044848cbd1c37a226e635e

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri May 29 08:59:41 2015 +0200

bsps/powerpc: Fix potential integer overflow

Update #2356.

---

 c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
index 41b10cb..0cb0544 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
@@ -248,7 +248,7 @@ rtems_device_driver Clock_initialize(
 
   Clock_TC.tc_get_timecount = Clock_Get_timecount;
   Clock_TC.tc_counter_mask = 0xffffffff;
-  Clock_TC.tc_frequency = (1000 * BSP_bus_frequency) / BSP_time_base_divisor;
+  Clock_TC.tc_frequency = (UINT64_C(1000) * BSP_bus_frequency) / BSP_time_base_divisor;
   Clock_TC.tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER;
   rtems_timecounter_install(&Clock_TC);
 




More information about the vc mailing list