drm/sun4i: Fix error handling
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 30 Oct 2016 08:49:26 +0000 (09:49 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 2 Nov 2016 17:56:46 +0000 (18:56 +0100)
'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>
drivers/gpu/drm/sun4i/sun4i_drv.c

index 0da9862ad8ed928e23a6a1e089551967ad5273e8..077f3785439ee5d77d9a799b052e7ad674827dea 100644 (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;