[Intel-gfx] [PATCH 22/37] drm: Free adjusted mode on set_mode() failure path.
Chris Wilson
chris at chris-wilson.co.uk
Wed Mar 10 23:45:09 CET 2010
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Dave Airlie <airlied at redhat.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 6b2cd91..d36c4ca 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -650,9 +650,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
adjusted_mode = drm_mode_duplicate(dev, mode);
crtc->enabled = drm_helper_crtc_in_use(crtc);
-
if (!crtc->enabled)
- return true;
+ goto done;
saved_mode = crtc->mode;
saved_x = crtc->x;
@@ -732,10 +731,10 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
}
- /* XXX free adjustedmode */
- drm_mode_destroy(dev, adjusted_mode);
/* FIXME: add subpixel order */
done:
+ drm_mode_destroy(dev, adjusted_mode);
+
if (!ret) {
crtc->mode = saved_mode;
crtc->x = saved_x;
--
1.7.0
More information about the Intel-gfx
mailing list