summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/fsl-dcu
diff options
context:
space:
mode:
authorMeng Yi <meng.yi@nxp.com>2016-01-06 07:12:05 +0300
committerStefan Agner <stefan@agner.ch>2016-02-26 03:13:16 +0300
commita36c9867d44718487262643cdefd12a386841b41 (patch)
tree2b5f75e64d6c53571bf455aa41cabcbc8290a887 /drivers/gpu/drm/fsl-dcu
parentbc66757a0eb3dc0479bed31164e2795480160612 (diff)
downloadlinux-a36c9867d44718487262643cdefd12a386841b41.tar.xz
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 <meng.yi@nxp.com> Signed-off-by: Jianwei Wang <jianwei.wang.chn@gmail.com> Signed-off-by: Stefan Agner <stefan@agner.ch>
Diffstat (limited to 'drivers/gpu/drm/fsl-dcu')
-rw-r--r--drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c3
1 files changed, 3 insertions, 0 deletions
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: