1
0
Fork 0

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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
hifive-unleashed-5.1
Christophe JAILLET 2016-10-30 09:49:26 +01:00 committed by Maxime Ripard
parent 0df03b4303
commit 6c08d7ab23
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ static int sun4i_drv_bind(struct device *dev)
/* Create our layers */
drv->layers = sun4i_layers_init(drm);
if (!drv->layers) {
if (IS_ERR(drv->layers)) {
dev_err(drm->dev, "Couldn't create the planes\n");
ret = -EINVAL;
goto free_drm;