From: Daniel Stone Date: Mon, 20 Apr 2015 18:22:50 +0000 (+0100) Subject: drm/atomic: Don't open-code CRTC state destroy X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9b0adc29d203116cadd81b663518104cfb19b48c;p=linux-beck.git drm/atomic: Don't open-code CRTC state destroy 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 Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index ab00286aec93..d727b73fba3a 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -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; }