diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-10-13 11:53:21 +0300 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2016-10-18 11:02:11 +0200 |
commit | 8cca354816adacb91280e19c50f81ffddc0460a4 (patch) | |
tree | 51c4569aaee015789117452321a45574108ece14 /drivers/gpu/drm/imx | |
parent | 81d553545a1510ff7c7c00cbc9b57d6172d411a4 (diff) | |
download | op-kernel-dev-8cca354816adacb91280e19c50f81ffddc0460a4.zip op-kernel-dev-8cca354816adacb91280e19c50f81ffddc0460a4.tar.gz |
drm/imx: drm_dev_alloc() returns error pointers
We are checking for NULL here, when we should be checking for error
pointers.
Fixes: 54db5decce17 ("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>
Diffstat (limited to 'drivers/gpu/drm/imx')
-rw-r--r-- | drivers/gpu/drm/imx/imx-drm-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index b084c57..9672b57 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -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) { |