[Intel-gfx] [PATCH] drm: Restore lost drm_framebuffer_unreference in drm_mode_page_flip_ioctl

Daniel Vetter daniel at ffwll.ch
Thu Sep 29 09:00:28 UTC 2016


On Wed, Sep 28, 2016 at 11:25:00PM +0100, Chris Wilson wrote:
> Commit 43968d7b806d ("drm: Extract drm_plane.[hc]") was not the simple
> cut'n'paste we presumed, somehow it introduced a leak of the page flip
> target's framebuffer.
> 
> Fixes: 43968d7b806d ("drm: Extract drm_plane.[hc]")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter at intel.com>
> Cc: Sean Paul <seanpaul at chromium.org>

Oops, thanks for catching this, applied to drm-misc.
-Daniel

> ---
>  drivers/gpu/drm/drm_plane.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index cd0d475bf3c3..783aef8acab7 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -898,6 +898,8 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
>  out:
>  	if (ret && crtc->funcs->page_flip_target)
>  		drm_crtc_vblank_put(crtc);
> +	if (fb)
> +		drm_framebuffer_unreference(fb);
>  	if (crtc->primary->old_fb)
>  		drm_framebuffer_unreference(crtc->primary->old_fb);
>  	crtc->primary->old_fb = NULL;
> -- 
> 2.9.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list