vmwgfx: return -EFAULT if copy_to_user fails
Subsystems (4)
PATCH 1/1 vmwgfx: return -EFAULT if copy_to_user fails
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]>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -0
@@ -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; }