提交 6c08d7ab 编写于 作者: C Christophe JAILLET 提交者: Maxime Ripard

drm/sun4i: Fix error handling

'sun4i_layers_init()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
上级 0df03b43
...@@ -142,7 +142,7 @@ static int sun4i_drv_bind(struct device *dev) ...@@ -142,7 +142,7 @@ static int sun4i_drv_bind(struct device *dev)
/* Create our layers */ /* Create our layers */
drv->layers = sun4i_layers_init(drm); drv->layers = sun4i_layers_init(drm);
if (!drv->layers) { if (IS_ERR(drv->layers)) {
dev_err(drm->dev, "Couldn't create the planes\n"); dev_err(drm->dev, "Couldn't create the planes\n");
ret = -EINVAL; ret = -EINVAL;
goto free_drm; goto free_drm;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册