summaryrefslogtreecommitdiff
path: root/linux/fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/fops.c')
-rw-r--r--linux/fops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/fops.c b/linux/fops.c
index f3966d96b..8e373e5ad 100644
--- a/linux/fops.c
+++ b/linux/fops.c
@@ -176,7 +176,8 @@ ssize_t drm_read(struct file *filp, char *buf, size_t count, loff_t *off)
} else {
cur = DRM_MIN(send, dev->buf_end - dev->buf_rp);
}
- copy_to_user_ret(buf, dev->buf_rp, cur, -EINVAL);
+ if (copy_to_user(buf, dev->buf_rp, cur))
+ return -EFAULT;
dev->buf_rp += cur;
if (dev->buf_rp == dev->buf_end) dev->buf_rp = dev->buf;
send -= cur;