drm: atmel-hlcdc: fix atmel_hlcdc_crtc_reset() implementation
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 22 Apr 2016 19:28:32 +0000 (21:28 +0200)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 1 Jun 2016 13:59:35 +0000 (15:59 +0200)
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 <boris.brezillon@free-electrons.com>
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c

index cf23a755f777f8b4df9fcc6b3032c01415c14bd8..ac4e0632c2de4f05237ac2d62933bf5a89369775 100644 (file)
@@ -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);