From f434c0c38c9bbdd308685d2c729ec6780331884d Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 13 Jun 2019 19:47:24 +0530 Subject: [PATCH] disp: msm: sde: Add null pointer check for plane state Add null check for plane state pointer before dereferencing it. Change-Id: Ic66efd11a70162ffe65c2137a5f19688314c45a5 Signed-off-by: Prashant Singh --- msm/sde/sde_plane.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index 334def1a92..0df6e285bd 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -3049,6 +3049,10 @@ static void _sde_plane_update_properties(struct drm_plane *plane, state = plane->state; pstate = to_sde_plane_state(state); + if (!pstate) { + SDE_ERROR("invalid plane state for plane%d\n", DRMID(plane)); + return; + } msm_fmt = msm_framebuffer_format(fb); if (!msm_fmt) {