Skip to content

Commit

Permalink
drm/i915: check the return value from the copy from user
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Airlie committed Mar 29, 2009
1 parent 90f959b commit d008877
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d008877

Please sign in to comment.