The atomic helpers rely on drm_atomic_state_clear() to reset an atomic
state if a retry is needed due to the w/w mutexes. The subsequent calls
to drm_atomic_get_{crtc,plane,...}_state() would then return the stale
pointers in state->{crtc,plane,...}_states.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
 
                connector->funcs->atomic_destroy_state(connector,
                                                       state->connector_states[i]);
+               state->connector_states[i] = NULL;
        }
 
        for (i = 0; i < config->num_crtc; i++) {
 
                crtc->funcs->atomic_destroy_state(crtc,
                                                  state->crtc_states[i]);
+               state->crtc_states[i] = NULL;
        }
 
        for (i = 0; i < config->num_total_plane; i++) {
 
                plane->funcs->atomic_destroy_state(plane,
                                                   state->plane_states[i]);
+               state->plane_states[i] = NULL;
        }
 }
 EXPORT_SYMBOL(drm_atomic_state_clear);