From de391d12500ede13faa7ecadbe900a8de1f76cfa Mon Sep 17 00:00:00 2001 From: Mattia Dongili Date: Thu, 18 Nov 2010 09:06:43 -0800 Subject: [PATCH] Input: fix typo in keycode validation supporting large scancodes 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 Tested-by: Norbert Preining Signed-off-by: Dmitry Torokhov --- drivers/input/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 7f26ca6ecf75..5edc41aa08f8 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -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; -- 2.39.5