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 <error27@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Родитель
772a2f9b48
Коммит
4ede00c966
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче