diff options
author | Alan Cox <alan@linux.intel.com> | 2012-06-27 12:02:07 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-06-27 17:35:55 +0200 |
commit | 954bd6d1c9f6a545a594517b1a4aa9262b613f14 (patch) | |
tree | 8c7f15be65a7c7cfd1f6c063b5a79a9f50c8c45b /drivers | |
parent | c224071e28e2bbd213cce2e6e9dde26e78542ca8 (diff) |
lm8333: Fix check ordering
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/keyboard/lm8333.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c index ca168a6679de..081fd9effa8c 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; |