From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH] lm8333: Fix check ordering Date: Wed, 4 Jul 2012 13:05:50 -0700 Message-ID: <20120704200550.GA13248@core.coreip.homeip.net> References: <20120704145653.7910.26502.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:54151 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753821Ab2GDUF4 (ORCPT ); Wed, 4 Jul 2012 16:05:56 -0400 Content-Disposition: inline In-Reply-To: <20120704145653.7910.26502.stgit@localhost.localdomain> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Alan Cox Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Kosina Hi Alan, On Wed, Jul 04, 2012 at 03:57:00PM +0100, Alan Cox wrote: > From: Alan Cox > > Fix harmless reference off end of array > > Reported-by: > Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?43861 > Signed-off-by: Alan Cox > --- > > drivers/input/keyboard/lm8333.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c > index ca168a6..081fd9e 100644 > --- a/drivers/input/keyboard/lm8333.c > +++ b/drivers/input/keyboard/lm8333.c > @@ -91,7 +91,7 @@ static void lm8333_key_handler(struct lm8333 *lm8333) > return; > } > > - for (i = 0; keys[i] && i < LM8333_FIFO_TRANSFER_SIZE; i++) { > + for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) { > pressed = keys[i] & 0x80; > code = keys[i] & 0x7f; > > I believe Jiri has already queued this through trivial tree... Thanks. -- Dmitry