]> err.no Git - linux-2.6/blobdiff - drivers/char/keyboard.c
[PATCH] Add missing overflow check in get_blkdev_list
[linux-2.6] / drivers / char / keyboard.c
index 3ce51c6a1b1821c6c25429ea813b1ab67a4ba91d..523fd3c8bbaa75dd345224799990ec0c4f4e5e93 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);
 
@@ -1026,7 +1026,8 @@ static void kbd_rawcode(unsigned char data)
                put_queue(vc, data);
 }
 
-void kbd_keycode(unsigned int keycode, int down, int hw_raw, struct pt_regs *regs)
+static void kbd_keycode(unsigned int keycode, int down,
+                       int hw_raw, struct pt_regs *regs)
 {
        struct vc_data *vc = vc_cons[fg_console].d;
        unsigned short keysym, *key_map;