From patchwork Sat Nov 13 19:21:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 322722 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oADJM492019930 for ; Sat, 13 Nov 2010 19:22:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755061Ab0KMTWE (ORCPT ); Sat, 13 Nov 2010 14:22:04 -0500 Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]:57585 "EHLO mtaout02-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754890Ab0KMTWD (ORCPT ); Sat, 13 Nov 2010 14:22:03 -0500 Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20101113192201.OWRI19887.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Sat, 13 Nov 2010 19:22:01 +0000 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20101113192201.BDAI28282.aamtaout03-winn.ispmail.ntl.com@zog.reactivated.net>; Sat, 13 Nov 2010 19:22:01 +0000 Received: by zog.reactivated.net (Postfix, from userid 1000) id 5E3B89D401B; Sat, 13 Nov 2010 19:21:58 +0000 (GMT) From: Daniel Drake To: dmitry.torokhov@gmail.com To: dtor@mail.ru Cc: linux-input@vger.kernel.org Cc: pgf@laptop.org Subject: [PATCH 1/4] Input: hgpk - detect simple mode overflows Message-Id: <20101113192158.5E3B89D401B@zog.reactivated.net> Date: Sat, 13 Nov 2010 19:21:58 +0000 (GMT) X-Cloudmark-Analysis: v=1.1 cv=JvdXmxIgLJv2/GthKqHpGJEEHukvLcvELVXUanXFreg= c=1 sm=0 a=zripQVQOmXsA:10 a=Op-mwl0xAAAA:8 a=sQqDQE0CGBSTl3O9y3YA:9 a=wTpSdkEyZ64G9jSZonRoFAbQZoAA:4 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 13 Nov 2010 19:22:05 +0000 (UTC) diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index b54f074..7f6cb32 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c @@ -431,6 +431,11 @@ static void hgpk_process_simple_packet(struct psmouse *psmouse) int x = packet[1] - ((packet[0] << 4) & 0x100); int y = ((packet[0] << 3) & 0x100) - packet[2]; + if (packet[0] & 0xc0) + hgpk_dbg(psmouse, + "overflow -- 0x%02x 0x%02x 0x%02x\n", + packet[0], packet[1], packet[2]); + if (hgpk_discard_decay_hack(psmouse, x, y)) { if (tpdebug) hgpk_dbg(psmouse, "discarding\n");