diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2016-10-30 04:49:26 -0400 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2016-11-02 13:56:46 -0400 |
commit | 6c08d7ab23dd07c046e8de1520073053bdc76ae2 (patch) | |
tree | e4c6b7b400168715006da9332073b98ebb4bc10f | |
parent | 0df03b43035afd0a64916fe4e5bca978562ffa5a (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
142 | 142 | ||
143 | /* Create our layers */ | 143 | /* Create our layers */ |
144 | drv->layers = sun4i_layers_init(drm); | 144 | drv->layers = sun4i_layers_init(drm); |
145 | if (!drv->layers) { | 145 | if (IS_ERR(drv->layers)) { |
146 | dev_err(drm->dev, "Couldn't create the planes\n"); | 146 | dev_err(drm->dev, "Couldn't create the planes\n"); |
147 | ret = -EINVAL; | 147 | ret = -EINVAL; |
148 | goto free_drm; | 148 | goto free_drm; |