path: root/drivers/gpu/drm/arm/hdlcd_drv.c
diff options
authorTom Gundersen <>2016-09-21 16:59:19 +0200
committerSean Paul <>2016-09-22 04:03:48 -0700
commit0f2886057be322ddfa4858384c40a505f7a32a4a (patch)
tree95fd93e32cce031f99920cd1937b4e46491e65b3 /drivers/gpu/drm/arm/hdlcd_drv.c
parentc6bf811a0b55ab224fb2c75345641b4bb599475c (diff)
drm: Don't swallow error codes in drm_dev_alloc()
There are many reasons other than ENOMEM that drm_dev_init() can fail. Return ERR_PTR rather than NULL to be able to distinguish these in the caller. Signed-off-by: Tom Gundersen <> Signed-off-by: Sean Paul <> Link:
Diffstat (limited to 'drivers/gpu/drm/arm/hdlcd_drv.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index d83b46a30327..fb6a418ce6be 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -326,8 +326,8 @@ static int hdlcd_drm_bind(struct device *dev)
return -ENOMEM;
drm = drm_dev_alloc(&hdlcd_driver, dev);
- if (!drm)
- return -ENOMEM;
+ if (IS_ERR(drm))
+ return PTR_ERR(drm);
drm->dev_private = hdlcd;
dev_set_drvdata(dev, drm);