From: Boris Brezillon Date: Fri, 22 Apr 2016 19:28:32 +0000 (+0200) Subject: drm: atmel-hlcdc: fix atmel_hlcdc_crtc_reset() implementation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2e4c99444f418b3c3b13b58dad4d951aa2f7f1b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm: atmel-hlcdc: fix atmel_hlcdc_crtc_reset() implementation Reset crtc->state to NULL after freeing the state object and call __drm_atomic_helper_crtc_destroy_state() helper instead of manually calling drm_property_unreference_blob(). Signed-off-by: Boris Brezillon --- diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index cf23a755f777..ac4e0632c2de 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -391,12 +391,11 @@ void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc) { struct atmel_hlcdc_crtc_state *state; - if (crtc->state && crtc->state->mode_blob) - drm_property_unreference_blob(crtc->state->mode_blob); - if (crtc->state) { + __drm_atomic_helper_crtc_destroy_state(crtc->state); state = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state); kfree(state); + crtc->state = NULL; } state = kzalloc(sizeof(*state), GFP_KERNEL);