From: Christophe JAILLET Date: Sun, 30 Oct 2016 08:49:26 +0000 (+0100) Subject: drm/sun4i: Fix error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6c08d7ab23dd07c046e8de1520073053bdc76ae2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Maxime Ripard --- diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 0da9862ad8ed..077f3785439e 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -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;