vppinfra: fix 32-bit overflow in os_cpu_clock_frequency 61/25661/3
authorDamjan Marion <damarion@cisco.com>
Wed, 4 Mar 2020 19:06:06 +0000 (20:06 +0100)
committerDave Barach <openvpp@barachs.net>
Sun, 8 Mar 2020 13:57:27 +0000 (13:57 +0000)
Type: fix
Change-Id: I23250fcbc70086584b5448baec9af9a1528992f5
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
src/vppinfra/time.c

index 27758dc..edeca1f 100644 (file)
@@ -165,7 +165,7 @@ os_cpu_clock_frequency (void)
 
       clib_get_cpuid (0x15, &eax, &ebx, &ecx, &edx);
       if (ebx && ecx)
-       return ecx * ebx / eax;
+       return (u64) ecx *ebx / eax;
 
       if (max_leaf >= 0x16)
        {