Commit e38648f9 authored by Haixia Shi's avatar Haixia Shi Committed by Dave Airlie

drm/udl: properly check for error pointers

The drm_prime_pages_to_sg() function never returns NULL pointers, only
error pointers and valid pointers.
Signed-off-by: default avatarHaixia Shi <hshi@chromium.org>
Reviewed-by: default avatarStéphane Marchesin <marcheu@chromium.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 4bc158e0
...@@ -99,9 +99,9 @@ static struct sg_table *udl_map_dma_buf(struct dma_buf_attachment *attach, ...@@ -99,9 +99,9 @@ static struct sg_table *udl_map_dma_buf(struct dma_buf_attachment *attach,
page_count = obj->base.size / PAGE_SIZE; page_count = obj->base.size / PAGE_SIZE;
obj->sg = drm_prime_pages_to_sg(obj->pages, page_count); obj->sg = drm_prime_pages_to_sg(obj->pages, page_count);
if (!obj->sg) { if (IS_ERR(obj->sg)) {
DRM_ERROR("sg is null.\n"); DRM_ERROR("failed to allocate sgt.\n");
return ERR_PTR(-ENOMEM); return ERR_CAST(obj->sg);
} }
sgt = &udl_attach->sgt; sgt = &udl_attach->sgt;
......
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