Commit d0088775 authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
parent 90f959bc
...@@ -446,13 +446,16 @@ fast_shmem_write(struct page **pages, ...@@ -446,13 +446,16 @@ fast_shmem_write(struct page **pages,
int length) int length)
{ {
char __iomem *vaddr; char __iomem *vaddr;
unsigned long unwritten;
vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT], KM_USER0); vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT], KM_USER0);
if (vaddr == NULL) if (vaddr == NULL)
return -ENOMEM; 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); kunmap_atomic(vaddr, KM_USER0);
if (unwritten)
return -EFAULT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment