vmwgfx: return -EFAULT instead of number of bytes remaining
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 18 Oct 2011 06:09:19 +0000 (09:09 +0300)
committerDave Airlie <airlied@redhat.com>
Tue, 18 Oct 2011 09:41:11 +0000 (10:41 +0100)
The intent here was to return an error code, but instead the code
returns the number of bytes remaining (that weren't copied).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c

index 97f23abeacda647eab399af9301bf1a719ebf33d..3f6343502d1f96aea110dccdeb59a39cb9fe0065 100644 (file)
@@ -150,6 +150,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
        ret = copy_from_user(clips, clips_ptr, num_clips * sizeof(*clips));
        if (ret) {
                DRM_ERROR("Failed to copy clip rects from userspace.\n");
+               ret = -EFAULT;
                goto out_no_copy;
        }
 
@@ -241,6 +242,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
        ret = copy_from_user(clips, clips_ptr, num_clips * sizeof(*clips));
        if (ret) {
                DRM_ERROR("Failed to copy clip rects from userspace.\n");
+               ret = -EFAULT;
                goto out_no_copy;
        }