aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/keyboard.c')
-rw-r--r--drivers/char/keyboard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 1745065d8f7..b12d58ee532 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -200,7 +200,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
return -EINVAL;
if (keycode < 0 || keycode > KEY_MAX)
return -EINVAL;
- if (keycode >> (dev->keycodesize * 8))
+ if (dev->keycodesize < sizeof(keycode) && (keycode >> (dev->keycodesize * 8)))
return -EINVAL;
oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode);