[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201118003148.GE2009714@dtor-ws>
Date: Tue, 17 Nov 2020 16:31:48 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Alexandru Ardelean <alexandru.ardelean@...log.com>,
Mark Brown <broonie@...nel.org>,
David Jander <david@...tonic.nl>, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
linux-spi@...r.kernel.org
Subject: Re: [PATCH v1] Input: touchscreen: ads7846.c: fix integer overflow
on Rt calculation
On Fri, Nov 13, 2020 at 12:22:40PM +0100, Oleksij Rempel wrote:
> In some rare cases the 32 bit Rt value will overflow if z2 and x is max,
> z1 is minimal value and x_plate_ohms is relatively high (for example 800
> ohm). This would happen on some screen age with low pressure.
>
> There are two possible fixes:
> - make Rt 64bit
> - reorder calculation to avoid overflow
>
> The second variant seems to be preferable, since 64 bit calculation on
> 32 bit system is a bit more expensive.
>
> Fixes: ffa458c1bd9b6f653008d450f337602f3d52a646 ("spi: ads7846 driver")
> Co-Developed-by: David Jander <david@...tonic.nl>
> Signed-off-by: David Jander <david@...tonic.nl>
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
Applied, thank you.
--
Dmitry
Powered by blists - more mailing lists