drm/sun4i: rgb: panel is an error pointer
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 4 May 2016 15:37:58 +0000 (17:37 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 30 May 2016 06:28:33 +0000 (08:28 +0200)
In case of an error, our pointer to the drm_panel structure attached to our
encoder will hold an error pointer, not a NULL pointer.

Make sure we check the right thing.

Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output")
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_rgb.c

index fe7ef52..aaffe9e 100644 (file)
@@ -217,7 +217,7 @@ int sun4i_rgb_init(struct drm_device *drm)
        int ret;
 
        /* If we don't have a panel, there's no point in going on */
-       if (!tcon->panel)
+       if (IS_ERR(tcon->panel))
                return -ENODEV;
 
        rgb = devm_kzalloc(drm->dev, sizeof(*rgb), GFP_KERNEL);