Skip to content

Commit

Permalink
lm8333: Fix check ordering
Browse files Browse the repository at this point in the history
Fix harmless reference off end of array

Reported-by: <dcb314@hotmail.com>
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?43861
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Alan Cox authored and Jiri Kosina committed Jun 27, 2012
1 parent c224071 commit 954bd6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/keyboard/lm8333.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 954bd6d

Please sign in to comment.