diff options
Diffstat (limited to 'linux/fops.c')
-rw-r--r-- | linux/fops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/fops.c b/linux/fops.c index bbb91f27..8e373e5a 100644 --- a/linux/fops.c +++ b/linux/fops.c @@ -29,7 +29,6 @@ * Daryll Strauss <daryll@valinux.com> * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.9 2000/08/28 02:43:14 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" @@ -177,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; |