Merge head 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[pandora-kernel.git] / drivers / char / keyboard.c
index 7b19e02..523fd3c 100644 (file)
@@ -198,10 +198,10 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
 
        if (scancode >= dev->keycodemax)
                return -EINVAL;
-       if (keycode > KEY_MAX)
-               return -EINVAL;
        if (keycode < 0 || keycode > KEY_MAX)
                return -EINVAL;
+       if (keycode >> (dev->keycodesize * 8))
+               return -EINVAL;
 
        oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode);