[PATCH] drm/atomic: fix potential null ptr on plane enable

Rob Clark robdclark at gmail.com
Mon Dec 8 07:45:43 PST 2014


When a plane is being enabled, plane->crtc has not been set yet.  Use
plane->state->crtc.

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
Looks like this is still missing on drm-next.. I probably forgot to
send it earlier.

 drivers/gpu/drm/drm_atomic_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
1.9.3



More information about the dri-devel mailing list