Skip to contentSkip to conversation

drm/atomic: fix potential null ptr on plane enable

PATCH Applied Rob Clark 3 participants 3 messages Dec 8, 2014

Subsystems (2)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 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.

---
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(-)
drivers/gpu/drm/drm_atomic_helper.c +1 -1
index 4a78a77..bbdbe47 100644
@@ -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;
Signature · 6 lines
1.9.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Rob Clark

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

Quoted 25 lines

---
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(-)
drivers/gpu/drm/drm_atomic_helper.c +1 -2
index 4a78a77..bbdbe47 100644
@@ -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

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 7 lines · Sean Paul
Quoted 4 lines · Rob Clark

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

Merged to topic/atomic-core, thanks.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel