From 6fcdc801e20b52a661cea0e71e1f2c6a8e9face6 Mon Sep 17 00:00:00 2001 From: Sergey Isakov Date: Tue, 17 Sep 2019 15:34:16 +0300 Subject: [PATCH] use safe division for uint64 Signed-off-by: Sergey Isakov --- rEFIt_UEFI/Platform/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rEFIt_UEFI/Platform/cpu.c b/rEFIt_UEFI/Platform/cpu.c index 09c9b0a58..4893fa55e 100644 --- a/rEFIt_UEFI/Platform/cpu.c +++ b/rEFIt_UEFI/Platform/cpu.c @@ -399,8 +399,8 @@ VOID GetCPUProperties (VOID) if (Num && Denom) { gCPUStructure.ARTFrequency = DivU64x32(MultU64x32(gCPUStructure.TSCCalibr, Denom), Num); DBG(" Calibrated ARTFrequency: %lld\n", gCPUStructure.ARTFrequency); - UINT64 Stokg = (gCPUStructure.ARTFrequency + 99999) / 100000; - gCPUStructure.ARTFrequency = Stokg * 100000; + UINT64 Stokg = DivU64x32(gCPUStructure.ARTFrequency + 99999, 100000); + gCPUStructure.ARTFrequency = MultU64x32(Stokg, 100000); DBG(" Rounded ARTFrequency: %lld\n", gCPUStructure.ARTFrequency); } }