提交 8cca3548 编写于 作者: D Dan Carpenter 提交者: Philipp Zabel

drm/imx: drm_dev_alloc() returns error pointers

We are checking for NULL here, when we should be checking for error
pointers.

Fixes: 54db5dec ("drm/imx: drop deprecated load/unload drm_driver ops")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NLucas Stach <l.stach@pengutronix.de>
Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
上级 81d55354
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册