summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/input/misc/uinput.c3
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,
struct input_event event;
int retval = 0;
+ if (count != 0 && count < input_event_size())
+ return -EINVAL;
+
if (udev->state != UIST_CREATED)
return -ENODEV;