Skip to content

Commit

Permalink
drm/udl: properly check for error pointers
Browse files Browse the repository at this point in the history
The drm_prime_pages_to_sg() function never returns NULL pointers, only
error pointers and valid pointers.

Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Haixia Shi authored and Dave Airlie committed Nov 26, 2014
1 parent 4bc158e commit e38648f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/udl/udl_dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ static struct sg_table *udl_map_dma_buf(struct dma_buf_attachment *attach,

page_count = obj->base.size / PAGE_SIZE;
obj->sg = drm_prime_pages_to_sg(obj->pages, page_count);
if (!obj->sg) {
DRM_ERROR("sg is null.\n");
return ERR_PTR(-ENOMEM);
if (IS_ERR(obj->sg)) {
DRM_ERROR("failed to allocate sgt.\n");
return ERR_CAST(obj->sg);
}

sgt = &udl_attach->sgt;
Expand Down

0 comments on commit e38648f

Please sign in to comment.