]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.53/hid-multitouch-handle-faulty-elo-touch-device.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.19.53 / hid-multitouch-handle-faulty-elo-touch-device.patch
1 From 81bcbad53bab4bf9f200eda303d7a05cdb9bd73b Mon Sep 17 00:00:00 2001
2 From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
3 Date: Tue, 21 May 2019 15:38:31 +0200
4 Subject: HID: multitouch: handle faulty Elo touch device
5
6 From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
7
8 commit 81bcbad53bab4bf9f200eda303d7a05cdb9bd73b upstream.
9
10 Since kernel v5.0, one single win8 touchscreen device failed.
11 And it turns out this is because it reports 2 InRange usage per touch.
12
13 It's a first, and I *really* wonder how this was allowed by Microsoft in
14 the first place. But IIRC, Breno told me this happened *after* a firmware
15 upgrade...
16
17 Anyway, better be safe for those crappy devices, and make sure we have
18 a full slot before jumping to the next.
19 This won't prevent all crappy devices to fail here, but at least we will
20 have a safeguard as long as the contact ID and the X and Y coordinates
21 are placed in the report after the grabage.
22
23 Fixes: 01eaac7e5713 ("HID: multitouch: remove one copy of values")
24 CC: stable@vger.kernel.org # v5.0+
25 Reported-and-tested-by: Breno Leitao <leitao@debian.org>
26 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
27 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30 diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
31 index c02d4cad1893..1565a307170a 100644
32 --- a/drivers/hid/hid-multitouch.c
33 +++ b/drivers/hid/hid-multitouch.c
34 @@ -641,6 +641,13 @@ static void mt_store_field(struct hid_device *hdev,
35 if (*target != DEFAULT_TRUE &&
36 *target != DEFAULT_FALSE &&
37 *target != DEFAULT_ZERO) {
38 + if (usage->contactid == DEFAULT_ZERO ||
39 + usage->x == DEFAULT_ZERO ||
40 + usage->y == DEFAULT_ZERO) {
41 + hid_dbg(hdev,
42 + "ignoring duplicate usage on incomplete");
43 + return;
44 + }
45 usage = mt_allocate_usage(hdev, application);
46 if (!usage)
47 return;