Merge tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / i915 / i915_debugfs.c
index dc057c770146931a173ef86709eaec70cd3993d3..20638d22bbad1eae081039fda72a641fc391d3ad 100644 (file)
@@ -4036,10 +4036,9 @@ static void hsw_trans_edp_pipe_A_crc_wa(struct drm_i915_private *dev_priv,
 
        ret = drm_atomic_commit(state);
 out:
-       drm_modeset_unlock_all(dev);
        WARN(ret, "Toggling workaround to %i returns %i\n", enable, ret);
-       if (ret)
-               drm_atomic_state_free(state);
+       drm_modeset_unlock_all(dev);
+       drm_atomic_state_put(state);
 }
 
 static int ivb_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,