From a84d692a5e0f894d7e9c81208197423d023f50d9 Mon Sep 17 00:00:00 2001 From: Daniel Martin Date: Fri, 2 Oct 2015 10:05:29 +0200 Subject: [PATCH 1/4] HID: multitouch: Ignore invalid reports Drop reports with invalid values. Signed-off-by: Daniel Martin --- drivers/hid/hid-multitouch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 7c81125..1cc1108 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -559,6 +559,10 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input) td->num_received >= td->num_expected) return; + if (td->curdata.x == 0xffff && td->curdata.x == td->curdata.y && + td->curdata.w == 0xffff && td->curdata.w == td->curdata.h) + goto inc_num_received; + if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) { int slotnum = mt_compute_slot(td, input); struct mt_slot *s = &td->curdata; @@ -597,6 +601,7 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input) } } +inc_num_received: td->num_received++; } -- 2.1.4