]> git.baikalelectronics.ru Git - kernel.git/commit
HID: wacom: Update last_slot_field during pre_report phase
authorJason Gerecke <killertofu@gmail.com>
Thu, 21 Jul 2016 16:10:46 +0000 (09:10 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 11 Aug 2016 20:37:13 +0000 (22:37 +0200)
commitcb03e4a3850c147ead38115775af048366513488
tree59681d43d7e07077e7e5a06a21f3ef64854d0da3
parenteb42a8dea6942a5aafcafe6c30c15666bbf0c24e
HID: wacom: Update last_slot_field during pre_report phase

If a touchscreen contains both multitouch and single-touch reports in its
descriptor in that order, the driver may overwrite information it saved
about the format of the multitouch report. This can cause the report
processing code to get tripped up and send an incorrect event stream to
userspace.

In particular, this can cause last_slot_field to be overwritten with the
result that the driver prematurely assumes it has finished processing a
slot and sending the ABS_MT_SLOT event at the wrong point in time,
associating events for the current contact with the following contact
instead.

To prevent this from occurring, we update the value of last_slot_field
durring the pre_report phase to ensure that it is correct for the report
that is to be processed.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h