drm: fsl-dcu: Fix no fb check bug
authorMeng Yi <meng.yi@nxp.com>
Wed, 6 Jan 2016 04:12:05 +0000 (12:12 +0800)
committerStefan Agner <stefan@agner.ch>
Fri, 26 Feb 2016 00:13:16 +0000 (16:13 -0800)
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 <meng.yi@nxp.com>
Signed-off-by: Jianwei Wang <jianwei.wang.chn@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c

index 4b13cf919575677d03c78e1d68811f21fbe58a8f..c83da72344ae144d7a261a594a475bcd43a2bedf 100644 (file)
@@ -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: