From: Subash Patel Date: Mon, 25 Jun 2012 18:22:57 +0000 (-0700) Subject: drm/exynos: check for null in return value of dma_buf_map_attachment() X-Git-Tag: v3.6-rc1~59^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dd3b72cc66117e5c6dc638f55e4f2e5cc60ed70;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git drm/exynos: check for null in return value of dma_buf_map_attachment() dma_buf_map_attachment() can return NULL and valid sg as return value. Hence the check for the returned scatter-gather must be using the inline function IS_ERR_OR_NULL() in place of IS_ERR() Signed-off-by: Subash Patel Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index cb29e47..1687b72 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c @@ -214,7 +214,7 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); - if (IS_ERR(sgt)) { + if (IS_ERR_OR_NULL(sgt)) { ret = PTR_ERR(sgt); goto err_buf_detach; }