Re: [PATCH] interconnect: qcom: msm8974: Prevent integer overflow in rate

From: Brian Masney
Date: Fri Nov 06 2020 - 19:42:39 EST


On Fri, Nov 06, 2020 at 04:48:47PM +0200, Georgi Djakov wrote:
> When sync_state support got introduced recently, by default we try to
> set the NoCs to run initially at maximum rate. But as these values are
> aggregated, we may end with a really big clock rate value, which is
> then converted from "u64" to "long" during the clock rate rounding.
> But on 32bit platforms this may result an overflow. Fix it by making
> sure that the rate is within range.
>
> Reported-by: Luca Weiss <luca@xxxxxxxxx>
> Fixes: b1d681d8d324 ("interconnect: Add sync state support")
> Signed-off-by: Georgi Djakov <georgi.djakov@xxxxxxxxxx>

Reviewed-by: Brian Masney <masneyb@xxxxxxxxxxxxx>