From: Rob Clark Date: Mon, 8 Dec 2014 15:45:43 +0000 (-0500) Subject: drm/atomic: fix potential null ptr on plane enable X-Git-Tag: v5.15~16316^2~44^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b08eae52f2f73723dbc4dd4d251eb60a7d8c0e1;p=platform%2Fkernel%2Flinux-starfive.git drm/atomic: fix potential null ptr on plane enable When a plane is being enabled, plane->crtc has not been set yet. Use plane->state->crtc. Signed-off-by: Rob Clark Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 4a78a77..bbdbe47 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -61,7 +61,7 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, struct drm_crtc_state *crtc_state; if (plane->state->crtc) { - crtc_state = state->crtc_states[drm_crtc_index(plane->crtc)]; + crtc_state = state->crtc_states[drm_crtc_index(plane->state->crtc)]; if (WARN_ON(!crtc_state)) return;