提交 954bd6d1 编写于 作者: A Alan Cox 提交者: Jiri Kosina

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?43861Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 c224071e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册