[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5ADSvcNvWx5vYui1v=jdUQ=K+HfETAm7xr5zg73DhqcFw@mail.gmail.com>
Date: Mon, 11 Jan 2021 15:07:57 -0300
From: Fabio Estevam <festevam@...il.com>
To: Geert Uytterhoeven <geert+renesas@...der.be>
Cc: Andrzej Hajda <a.hajda@...sung.com>,
Neil Armstrong <narmstrong@...libre.com>,
Jernej Skrabec <jernej.skrabec@...l.net>,
Jonas Karlman <jonas@...boo.se>,
David Airlie <airlied@...ux.ie>,
linux-kernel <linux-kernel@...r.kernel.org>,
DRI mailing list <dri-devel@...ts.freedesktop.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>
Subject: Re: [PATCH] drm/bridge: nwl-dsi: Avoid potential multiplication
overflow on 32-bit
Hi Geert,
On Mon, Jan 11, 2021 at 10:02 AM Geert Uytterhoeven
<geert+renesas@...der.be> wrote:
>
> As nwl_dsi.lanes is u32, and NSEC_PER_SEC is 1000000000L, the second
> multiplication in
>
> dsi->lanes * 8 * NSEC_PER_SEC
>
> will overflow on a 32-bit platform. Fix this by making the constant
> unsigned long long, forcing 64-bit arithmetic.
>
> While iMX8 is arm64, this driver is currently used on 64-bit platforms
> only, where long is 64-bit, so this cannot happen. But the issue may
> start to happen when the driver is reused for a 32-bit SoC, or when code
> is copied for a new driver.
This IP is also present on i.MX7ULP, which is 32-bit, but not supported yet.
Thanks for taking care of this.
Reviewed-by: Fabio Estevam <festevam@...il.com>
Powered by blists - more mailing lists