Skip to content

Commit c2e4c99

Browse files
author
Boris Brezillon
committed
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 <[email protected]>
1 parent 1a695a9 commit c2e4c99

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,11 @@ void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc)
391391
{
392392
struct atmel_hlcdc_crtc_state *state;
393393

394-
if (crtc->state && crtc->state->mode_blob)
395-
drm_property_unreference_blob(crtc->state->mode_blob);
396-
397394
if (crtc->state) {
395+
__drm_atomic_helper_crtc_destroy_state(crtc->state);
398396
state = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state);
399397
kfree(state);
398+
crtc->state = NULL;
400399
}
401400

402401
state = kzalloc(sizeof(*state), GFP_KERNEL);

0 commit comments

Comments
 (0)