* [patch] vmwgfx: return -EFAULT if copy_to_user fails
@ 2010-07-10 14:30 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-07-10 14:30 UTC (permalink / raw)
To: David Airlie; +Cc: Dave Airlie, kernel-janitors, Thomas Hellstrom, dri-devel
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>
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index f1d6261..437ac78 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;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-10 14:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-10 14:30 [patch] vmwgfx: return -EFAULT if copy_to_user fails Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).