Skip to content

Commit

Permalink
vmwgfx: return -EFAULT if copy_to_user fails
Browse files Browse the repository at this point in the history
copy_to_user() returns the number of bytes remaining to be copied, but
we want to return a negative error code.  This gets copied to user
space.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
error27 authored and airlied committed Jul 20, 2010
1 parent 772a2f9 commit 4ede00c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
ret = copy_from_user(rects, user_rects, rects_size);
if (unlikely(ret != 0)) {
DRM_ERROR("Failed to get rects.\n");
ret = -EFAULT;
goto out_free;
}

Expand Down

0 comments on commit 4ede00c

Please sign in to comment.