drm/atomic: Don't open-code CRTC state destroy
authorDaniel Stone <daniels@collabora.com>
Mon, 20 Apr 2015 18:22:50 +0000 (19:22 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 7 May 2015 09:03:02 +0000 (11:03 +0200)
One failure path in crtc_helper had an open-coded CRTC state destroy
which didn't actually call through to the driver's specified state
destroy. Fix that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc_helper.c

index ab00286aec938ddc737c0588e46cf4616526c20f..d727b73fba3a43e95bb5d08bef3ea5133b33f70e 100644 (file)
@@ -959,7 +959,12 @@ int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mod
        if (crtc_funcs->atomic_check) {
                ret = crtc_funcs->atomic_check(crtc, crtc_state);
                if (ret) {
-                       kfree(crtc_state);
+                       if (crtc->funcs->atomic_destroy_state) {
+                               crtc->funcs->atomic_destroy_state(crtc,
+                                                                 crtc_state);
+                       } else {
+                               kfree(crtc_state);
+                       }
 
                        return ret;
                }