]> Gentwo Git Trees - linux/.git/commit
Input: tsc2007 - prevent overflow in pressure calculation
authorJohannes Kirchmair <johannes.kirchmair@skidata.com>
Wed, 29 Jan 2025 13:51:20 +0000 (14:51 +0100)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 3 Sep 2025 14:44:00 +0000 (07:44 -0700)
commit9a12e2fb3f517d5bd72efa565a8e591e6fff311c
tree4e93535053cc2c277d20d5692f54c59624ac5207
parentd504bbda8ca689585bdf663514a187dd3c9f0226
Input: tsc2007 - prevent overflow in pressure calculation

The touch resistance calculation in the tsc2007 driver is prone to
overflow if (z2 - z1) is large and also x is reasonably big. This
overflow results in the driver emitting input events when very little
touch pressure is applied. In these events the x and y coordinates can
be substantially off.

Avoid the overflow by using u64 when calculating resistance value.

Signed-off-by: Johannes Kirchmair <johannes.kirchmair@skidata.com>
Link: https://lore.kernel.org/r/20250129-fix_tsc_calculation_overflow-v2-1-9e51333496ad@skidata.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/tsc2007_core.c