drm/exynos: fix NULL pointer reference
authorJoonyoung Shim <jy0922.shim@samsung.com>
Thu, 5 Feb 2015 07:11:38 +0000 (16:11 +0900)
committerInki Dae <inki.dae@samsung.com>
Mon, 9 Feb 2015 14:56:36 +0000 (23:56 +0900)
There is a case called disable_plane callback function even if
plane->crtc is NULL from exynos_drm_encoder_disable and it will cause
NULL pointer reference error.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_encoder.c

index 7e282e3d603826cefb4f43d53a588dc3a2d55830..57de0bdc5a3b4e72c42d7cc7c05dbc255c9a10a8 100644 (file)
@@ -102,7 +102,7 @@ static void exynos_drm_encoder_disable(struct drm_encoder *encoder)
 
        /* all planes connected to this encoder should be also disabled. */
        drm_for_each_legacy_plane(plane, &dev->mode_config.plane_list) {
-               if (plane->crtc == encoder->crtc)
+               if (plane->crtc && (plane->crtc == encoder->crtc))
                        plane->funcs->disable_plane(plane);
        }
 }