diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/misc/uinput.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 1b4ee4a5c49c..e74ed9cc6371 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
@@ -476,6 +476,9 @@ static ssize_t uinput_read(struct file *file, char __user *buffer, size_t count, | |||
476 | struct input_event event; | 476 | struct input_event event; |
477 | int retval = 0; | 477 | int retval = 0; |
478 | 478 | ||
479 | if (count != 0 && count < input_event_size()) | ||
480 | return -EINVAL; | ||
481 | |||
479 | if (udev->state != UIST_CREATED) | 482 | if (udev->state != UIST_CREATED) |
480 | return -ENODEV; | 483 | return -ENODEV; |
481 | 484 | ||