aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/udl
diff options
context:
space:
mode:
authorHaixia Shi <hshi@chromium.org>2014-11-25 15:04:03 -0500
committerDave Airlie <airlied@redhat.com>2014-11-25 19:03:18 -0500
commite38648f95d197b2296dec4b8c1f9a163c362f31e (patch)
tree49c4c0363e3efdaade162d06a6575deb5abe3c61 /drivers/gpu/drm/udl
parent4bc158e0be4b03b320db9f3b91a84c898ae928a0 (diff)
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: Haixia Shi <hshi@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/udl')
-rw-r--r--drivers/gpu/drm/udl/udl_dmabuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/udl/udl_dmabuf.c b/drivers/gpu/drm/udl/udl_dmabuf.c
index 2425b76dc44c..ac8a66b4dfc2 100644
--- a/drivers/gpu/drm/udl/udl_dmabuf.c
+++ b/drivers/gpu/drm/udl/udl_dmabuf.c
@@ -99,9 +99,9 @@ static struct sg_table *udl_map_dma_buf(struct dma_buf_attachment *attach,
99 99
100 page_count = obj->base.size / PAGE_SIZE; 100 page_count = obj->base.size / PAGE_SIZE;
101 obj->sg = drm_prime_pages_to_sg(obj->pages, page_count); 101 obj->sg = drm_prime_pages_to_sg(obj->pages, page_count);
102 if (!obj->sg) { 102 if (IS_ERR(obj->sg)) {
103 DRM_ERROR("sg is null.\n"); 103 DRM_ERROR("failed to allocate sgt.\n");
104 return ERR_PTR(-ENOMEM); 104 return ERR_CAST(obj->sg);
105 } 105 }
106 106
107 sgt = &udl_attach->sgt; 107 sgt = &udl_attach->sgt;