summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2012-10-20 10:32:47 +0000
committerDave Airlie <airlied@redhat.com>2012-10-23 10:14:58 +1000
commit028132451667ffd25b6814d47a622ec03cb8cba7 (patch)
tree6c73fe777af9c267263e58dc040f339fccc9d30f
parente0d78d08e3c06ebe2eb45b4d84f8cd5d1b13d371 (diff)
drm: fb: cma: Fail gracefully on allocation failure
The drm_gem_cma_create() function never returns NULL but rather an error encoded in the return value using the ERR_PTR() macro. Callers therefore need to check for errors using the IS_ERR() macro. This change allows drivers to handle contiguous DMA allocation failures gracefully. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_fb_cma_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index d6c80a34b830..fd9d0af4d536 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -220,7 +220,7 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper,
size = mode_cmd.pitches[0] * mode_cmd.height;
obj = drm_gem_cma_create(dev, size);
- if (!obj)
+ if (IS_ERR(obj))
return -ENOMEM;
fbi = framebuffer_alloc(0, dev->dev);