From: Meng Yi Date: Wed, 6 Jan 2016 04:12:05 +0000 (+0800) Subject: drm: fsl-dcu: Fix no fb check bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a36c9867d44718487262643cdefd12a386841b41;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: fsl-dcu: Fix no fb check bug For state->fb or state->crtc may be NULL in fsl_dcu_drm_plane_atomic_check function, if so, return 0. Signed-off-by: Meng Yi Signed-off-by: Jianwei Wang Signed-off-by: Stefan Agner --- diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index 4b13cf919575..c83da72344ae 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -41,6 +41,9 @@ static int fsl_dcu_drm_plane_atomic_check(struct drm_plane *plane, { struct drm_framebuffer *fb = state->fb; + if (!state->fb || !state->crtc) + return 0; + switch (fb->pixel_format) { case DRM_FORMAT_RGB565: case DRM_FORMAT_RGB888: