From patchwork Fri Jun 4 23:19:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 104352 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o54NJwRd007624 for ; Fri, 4 Jun 2010 23:19:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757454Ab0FDXT5 (ORCPT ); Fri, 4 Jun 2010 19:19:57 -0400 Received: from mail-ew0-f223.google.com ([209.85.219.223]:41219 "EHLO mail-ew0-f223.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757065Ab0FDXT4 (ORCPT ); Fri, 4 Jun 2010 19:19:56 -0400 Received: by ewy23 with SMTP id 23so438938ewy.1 for ; Fri, 04 Jun 2010 16:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=nkBIQLLJ+Wu8u314g51oSJyqKVhAzXHwZOcuEIkcS8o=; b=ERFVHqURd+1tVfy1YOxr15ULu5hKVgQysLTxBQOWW1Ueb3VKsaB7T5FTlNrUFK9lZT ioO6tyW1FyJWqbODNIuAUkxaqtNjhfizfQ2EluVuPcD+1j57VE2w54NDWGLwm+3Ikady g9SxzLY4079q/CDBYTVhpuRBgednrEqlZpxRE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=BTV7HfVqM49apMXsjYokIY56Qh+OcFrWZerA1PfSK38nCy8+wjD1yo5R6XbfDX1oiP QSJAeVSJLevl252840XZwVagsG+sZvJVlW2wkzcWYiLBmCVUFBKMQOITLQx9B1YVNKAt 7YiaCKEYzElc4M7ScDhVrni+M/lSPeBokr80A= Received: by 10.213.31.139 with SMTP id y11mr3472889ebc.2.1275693594299; Fri, 04 Jun 2010 16:19:54 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 15sm1001280ewy.4.2010.06.04.16.19.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Jun 2010 16:19:53 -0700 (PDT) Date: Sat, 5 Jun 2010 01:19:39 +0200 From: Dan Carpenter To: Dmitry Torokhov Cc: Mike Frysinger , Jean Delvare , Greg Kroah-Hartman , Richard Purdie , linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] input: off by one in pcf8574_kp_irq_handler() Message-ID: <20100604231939.GJ5483@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 (demeter.kernel.org [140.211.167.41]); Fri, 04 Jun 2010 23:19:58 +0000 (UTC) diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c index 0ac47d2..4b42ffc 100644 --- a/drivers/input/misc/pcf8574_keypad.c +++ b/drivers/input/misc/pcf8574_keypad.c @@ -69,7 +69,7 @@ static irqreturn_t pcf8574_kp_irq_handler(int irq, void *dev_id) unsigned char nextstate = read_state(lp); if (lp->laststate != nextstate) { - int key_down = nextstate <= ARRAY_SIZE(lp->btncode); + int key_down = nextstate < ARRAY_SIZE(lp->btncode); unsigned short keycode = key_down ? lp->btncode[nextstate] : lp->btncode[lp->laststate];