diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/keyboard.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 1745065d8f78..b12d58ee532b 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -200,7 +200,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode) | |||
200 | return -EINVAL; | 200 | return -EINVAL; |
201 | if (keycode < 0 || keycode > KEY_MAX) | 201 | if (keycode < 0 || keycode > KEY_MAX) |
202 | return -EINVAL; | 202 | return -EINVAL; |
203 | if (keycode >> (dev->keycodesize * 8)) | 203 | if (dev->keycodesize < sizeof(keycode) && (keycode >> (dev->keycodesize * 8))) |
204 | return -EINVAL; | 204 | return -EINVAL; |
205 | 205 | ||
206 | oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); | 206 | oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); |