summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-01-09 15:37:40 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-01-09 15:37:40 -0800
commitb5b3159cff66b5b6830701d318b470d4b3e9a57f (patch)
treee5549a32e3151d498eff5851eb63f36bf565f1ee /drivers/input/keyboard
parente69ec487b2c7c82ef99b4b15122f58a2a99289a3 (diff)
parent1021dcf19db1387bc0db26d14bbcba719923a466 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: "Just a few small fixups here" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: imx_sc_key - only take the valid data from SCU firmware as key state Input: add safety guards to input_set_keycode() Input: input_event - fix struct padding on sparc64 Input: uinput - always report EPOLLOUT
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/imx_sc_key.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c
index 53799527dc75..9f809aeb785c 100644
--- a/drivers/input/keyboard/imx_sc_key.c
+++ b/drivers/input/keyboard/imx_sc_key.c
@@ -78,7 +78,13 @@ static void imx_sc_check_for_events(struct work_struct *work)
return;
}
- state = (bool)msg.state;
+ /*
+ * The response data from SCU firmware is 4 bytes,
+ * but ONLY the first byte is the key state, other
+ * 3 bytes could be some dirty data, so we should
+ * ONLY take the first byte as key state.
+ */
+ state = (bool)(msg.state & 0xff);
if (state ^ priv->keystate) {
priv->keystate = state;