diff options
author | Ian Campbell <ijc@hellion.org.uk> | 2005-09-04 01:41:14 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-04 01:41:14 -0500 |
commit | 4cee99564db7f65a6f88e4b752da52768cde3802 (patch) | |
tree | 6c355494c3c399d2c1fc2d746171f434ded907e4 /drivers/char/keyboard.c | |
parent | d2b5ffca73594e4046f405e3ef2438ce41f76fb2 (diff) |
Input: fix checking whether new keycode fits size-wise
When dev->keycodesize == sizeof(int) the old code produces
incorrect result.
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
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 523fd3c8bba..1ddaabeb8ef 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); |