diff options
Diffstat (limited to 'drivers/char/keyboard.c')
| -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 523fd3c8bbaa..1ddaabeb8ef8 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); |
