Skip to content

Commit

Permalink
Input: fix typo in keycode validation supporting large scancodes
Browse files Browse the repository at this point in the history
Check the input_keymap_entry keycode size (u32) instead of the device's
(void*) when validating that keycode value can be stored in the keymap.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=22722

Signed-off-by: Mattia Dongili <malattia@linux.it>
Tested-by: Norbert Preining <preining@logic.at>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Mattia Dongili authored and Dmitry Torokhov committed Nov 18, 2010
1 parent 6f07d31 commit de391d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ static int input_default_setkeycode(struct input_dev *dev,
if (index >= dev->keycodemax)
return -EINVAL;

if (dev->keycodesize < sizeof(dev->keycode) &&
if (dev->keycodesize < sizeof(ke->keycode) &&
(ke->keycode >> (dev->keycodesize * 8)))
return -EINVAL;

Expand Down

0 comments on commit de391d1

Please sign in to comment.