]> git.baikalelectronics.ru Git - kernel.git/commit
Input: appletouch - fix integer overflow issue
authorVadim Zaliva <lord@crocodile.org>
Thu, 11 Mar 2010 07:41:00 +0000 (23:41 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 11 Mar 2010 08:00:56 +0000 (00:00 -0800)
commit678e7a6a7cc92158ab2fbb42de9ffd316eab5b4b
treee433748561def86a9568b3adb988b5a187e79ee5
parent23b2c5b400b22efdf205e2c8460632d246c28a9f
Input: appletouch - fix integer overflow issue

When reading data from Geyser 2 touchpads used on post Oct 2005 Apple
PowerBooks the driver was casting X and Y coordinates values to
'signed char'. Testing on one of such PowerBooks I have noticed that
touchpad always generates positive values, but some of them are greater
that 127, and thus, when cast to 'signed char' being interpreted as
a negative.

Such bigger values have been observed infrequently, closer to the
edges of a touchpad, so the problem was not very visible.
Nevertheless, the patch would potentially improve touchpad
driver accuracy.

Signed-off-by: Vadim Zaliva <lord@crocodile.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/mouse/appletouch.c