aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
446 int length) 446 int length)
447{ 447{
448 char __iomem *vaddr; 448 char __iomem *vaddr;
449 unsigned long unwritten;
449 450
450 vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT], KM_USER0); 451 vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT], KM_USER0);
451 if (vaddr == NULL) 452 if (vaddr == NULL)
452 return -ENOMEM; 453 return -ENOMEM;
453 __copy_from_user_inatomic(vaddr + page_offset, data, length); 454 unwritten = __copy_from_user_inatomic(vaddr + page_offset, data, length);
454 kunmap_atomic(vaddr, KM_USER0); 455 kunmap_atomic(vaddr, KM_USER0);
455 456
457 if (unwritten)
458 return -EFAULT;
456 return 0; 459 return 0;
457} 460}
458 461