summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-03-28 20:29:48 -0400
committerDave Airlie <airlied@redhat.com>2009-03-28 20:29:48 -0400
commitd008877550d8ca8c6878dd494e50c1b9209f38d4 (patch)
tree7ce65d9e868b05bac04201ebfc089ea1228b134a /drivers/gpu
parent90f959bcb386da2c71613dcefc6a285e054a539e (diff)
downloadlinux-stable-d008877550d8ca8c6878dd494e50c1b9209f38d4.tar.gz
linux-stable-d008877550d8ca8c6878dd494e50c1b9209f38d4.tar.bz2
linux-stable-d008877550d8ca8c6878dd494e50c1b9209f38d4.zip
drm/i915: check the return value from the copy from user
This produced a warning on my build, not sure why super-warning-man didn't notice this one, its much worse than the %z one. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e5d2bdf2cc9b..e0389ad1477d 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -446,13 +446,16 @@ fast_shmem_write(struct page **pages,
int length)
{
char __iomem *vaddr;
+ unsigned long unwritten;
vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT], KM_USER0);
if (vaddr == NULL)
return -ENOMEM;
- __copy_from_user_inatomic(vaddr + page_offset, data, length);
+ unwritten = __copy_from_user_inatomic(vaddr + page_offset, data, length);
kunmap_atomic(vaddr, KM_USER0);
+ if (unwritten)
+ return -EFAULT;
return 0;
}