if (ret)
goto fail;
- intel_set_mode(crtc, state);
-
- drm_atomic_state_free(state);
+ ret = intel_set_mode(crtc, state);
+ if (ret)
+ goto fail;
if (old->release_fb) {
drm_framebuffer_unregister_private(old->release_fb);
intel_crtc->config = crtc_state_copy;
intel_crtc->base.state = &crtc_state_copy->base;
+ drm_atomic_state_free(state);
+
return 0;
}
struct intel_connector *connector;
struct drm_connector_state *connector_state;
struct intel_crtc_state *crtc_state;
+ int ret;
state = drm_atomic_state_alloc(dev);
if (!state) {
intel_modeset_setup_plane_state(state, crtc, &crtc->mode,
crtc->primary->fb, crtc->x, crtc->y);
- intel_set_mode(crtc, state);
-
- drm_atomic_state_free(state);
+ ret = intel_set_mode(crtc, state);
+ if (ret)
+ drm_atomic_state_free(state);
}
#undef for_each_intel_crtc_masked
}
out:
- drm_atomic_state_free(state);
+ if (ret)
+ drm_atomic_state_free(state);
return ret;
}