diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index 0617e87ab343925f9568eef6a9a508afe68b0ecc..8d6074f8ba41f291d87ce9df6254a3fbc077701a 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -1491,7 +1491,7 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type, if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev)) kbd_rawcode(value); - if (event_type == EV_KEY) + if (event_type == EV_KEY && event_code <= KEY_MAX) kbd_keycode(event_code, value, HW_RAW(handle->dev)); spin_unlock(&kbd_event_lock);