lkml.org 
[lkml]   [2015]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] USB: HID: Fix fields from pen report ID being interpreted for multitouch.
Date
Fields like HID_DG_CONTACTCOUNT are outside of the physical collection,
but within the application collection and report ID. Make sure to catch
those fields that are not part of the mt_report_id and return 0 so they
can be processed with the pen. Otherwise, the wrong HID_DG_CONTACTCOUNT
will be applied to cc_index and result in dereferencing a null pointer in
mt_touch_report.

Signed-off-by: Brent Adam <brentadam@smarttech.com>
---
drivers/hid/hid-multitouch.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 6a9b05b..2ee8800 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -781,6 +781,9 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
*/
if (field->physical == HID_DG_STYLUS)
return 0;
+ else if ((field->physical == 0) &&
+ (field->report->id != td->mt_report_id))
+ return 0;

if (field->application == HID_DG_TOUCHSCREEN ||
field->application == HID_DG_TOUCHPAD)
--
2.1.4


\
 
 \ /
  Last update: 2015-06-09 23:21    [W:2.013 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site