Skip to content

Commit

Permalink
drm/imx: drm_dev_alloc() returns error pointers
Browse files Browse the repository at this point in the history
We are checking for NULL here, when we should be checking for error
pointers.

Fixes: 54db5de ("drm/imx: drop deprecated load/unload drm_driver ops")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
Dan Carpenter authored and Philipp Zabel committed Oct 18, 2016
1 parent 81d5535 commit 8cca354
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/imx/imx-drm-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ static int imx_drm_bind(struct device *dev)
int ret;

drm = drm_dev_alloc(&imx_drm_driver, dev);
if (!drm)
return -ENOMEM;
if (IS_ERR(drm))
return PTR_ERR(drm);

imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL);
if (!imxdrm) {
Expand Down

0 comments on commit 8cca354

Please sign in to comment.