Hi Inki, On 4 January 2016 at 12:57, Inki Dae <inki.dae at samsung.com> wrote: > 2015ë 12ì 24ì¼ 22:32ì Daniel Stone ì´(ê°) ì´ ê¸: >> On 24 December 2015 at 09:10, Inki Dae <inki.dae at samsung.com> wrote: >>> +void exynos_drm_crtc_cancel_page_flip(struct drm_crtc *crtc) >>> +{ >>> + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); >>> + unsigned long flags; >>> + >>> + spin_lock_irqsave(&crtc->dev->event_lock, flags); >>> + exynos_crtc->event = NULL; >>> + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); >>> +} >> >> This will leak the event and event space; you should call >> event->base.destroy() here. With that fixed: > > Right. we don't use exynos specific page flip function anymore which managed > the event as a list so that the event objects can be freed by postclose > callback. > Anyway, would it be better for event->base.destory() to be called between > spin lock/unlock?
You must increment event->base.file_priv->event_space (see drm_atomic.c:destroy_vblank_event), as well as calling event->base.destroy (see drm_fops.c:drm_read) underneath event_lock, yes. Cheers, Daniel