Input: fix typo in keycode validation supporting large scancodes
authorMattia Dongili <malattia@linux.it>
Thu, 18 Nov 2010 17:06:43 +0000 (09:06 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 18 Nov 2010 17:20:42 +0000 (09:20 -0800)
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>
drivers/input/input.c

index 7f26ca6ecf75dc6f15185771a8bae6cfb24ce58d..5edc41aa08f8cf56336365f75b514b2274d31dd5 100644 (file)
@@ -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;