Commit 021a8455 authored by Chris Wilson's avatar Chris Wilson

drm: Avoid leak of adjusted mode along quick set_mode paths

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent ede3ff52
...@@ -343,13 +343,12 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, ...@@ -343,13 +343,12 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
struct drm_encoder *encoder; struct drm_encoder *encoder;
bool ret = true; bool ret = true;
adjusted_mode = drm_mode_duplicate(dev, mode);
crtc->enabled = drm_helper_crtc_in_use(crtc); crtc->enabled = drm_helper_crtc_in_use(crtc);
if (!crtc->enabled) if (!crtc->enabled)
return true; return true;
adjusted_mode = drm_mode_duplicate(dev, mode);
saved_hwmode = crtc->hwmode; saved_hwmode = crtc->hwmode;
saved_mode = crtc->mode; saved_mode = crtc->mode;
saved_x = crtc->x; saved_x = crtc->x;
...@@ -437,10 +436,9 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, ...@@ -437,10 +436,9 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
*/ */
drm_calc_timestamping_constants(crtc); drm_calc_timestamping_constants(crtc);
/* XXX free adjustedmode */
drm_mode_destroy(dev, adjusted_mode);
/* FIXME: add subpixel order */ /* FIXME: add subpixel order */
done: done:
drm_mode_destroy(dev, adjusted_mode);
if (!ret) { if (!ret) {
crtc->hwmode = saved_hwmode; crtc->hwmode = saved_hwmode;
crtc->mode = saved_mode; crtc->mode = saved_mode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment