summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/yurex.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/yurex.c')
-rw-r--r--drivers/usb/misc/yurex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index e8e8702d5adf..5594a4a4a83f 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -431,6 +431,9 @@ static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count,
spin_unlock_irqrestore(&dev->lock, flags);
mutex_unlock(&dev->io_mutex);
+ if (WARN_ON_ONCE(len >= sizeof(in_buffer)))
+ return -EIO;
+
return simple_read_from_buffer(buffer, count, ppos, in_buffer, len);
}