Skip to content

Commit

Permalink
drivers/gpu: Use vzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Joe Perches authored and Dave Airlie committed Nov 9, 2010
1 parent 1ef0724 commit ec3789c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/via/via_dmablit.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
vsg->num_pages = VIA_PFN(xfer->mem_addr + (xfer->num_lines * xfer->mem_stride - 1)) -
first_pfn + 1;

if (NULL == (vsg->pages = vmalloc(sizeof(struct page *) * vsg->num_pages)))
vsg->pages = vzalloc(sizeof(struct page *) * vsg->num_pages);
if (NULL == vsg->pages)
return -ENOMEM;
memset(vsg->pages, 0, sizeof(struct page *) * vsg->num_pages);
down_read(&current->mm->mmap_sem);
ret = get_user_pages(current, current->mm,
(unsigned long)xfer->mem_addr,
Expand Down

0 comments on commit ec3789c

Please sign in to comment.