diff options
author | Dan Carpenter <error27@gmail.com> | 2010-07-10 16:30:04 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-07-20 15:24:11 +1000 |
commit | 4ede00c96632bcf8a21dd69ac0248f4c40b4cd0e (patch) | |
tree | be8837d8c3229ed40819aa3eb7f6dd027de6123c | |
parent | 772a2f9b488f4d27c314da5eeabde750b9ead41b (diff) | |
download | linux-4ede00c96632bcf8a21dd69ac0248f4c40b4cd0e.tar.bz2 |
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>
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index f1d626112415..437ac786277a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -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; } |