drm/atomic: fix potential null ptr on plane enable
authorRob Clark <robdclark@gmail.com>
Mon, 8 Dec 2014 15:45:43 +0000 (10:45 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 17 Dec 2014 17:39:57 +0000 (18:39 +0100)
When a plane is being enabled, plane->crtc has not been set yet.  Use
plane->state->crtc.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_atomic_helper.c

index 4a78a773151ce71f464d36cc4d1d6d887eea1619..bbdbe4721573a92667fe3989bbc1e0be8123bc2b 100644 (file)
@@ -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;