[PATCH] drm: Fix framebuffer leak

Daniel Vetter daniel at ffwll.ch
Wed Aug 9 16:42:56 UTC 2017


On Wed, Aug 09, 2017 at 09:23:01AM +0530, Nikhil Mahale wrote:
> Do not leak framebuffer if client provided crtc id found invalid.
> 
> Signed-off-by: Nikhil Mahale <nmahale at nvidia.com>

Nice catch, applied for 4.13-rc and cc: stable.
-Daniel

> ---
>  drivers/gpu/drm/drm_plane.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 5dc8c43..e40c12f 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -601,6 +601,7 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
>  
>  		crtc = drm_crtc_find(dev, plane_req->crtc_id);
>  		if (!crtc) {
> +			drm_framebuffer_put(fb);
>  			DRM_DEBUG_KMS("Unknown crtc ID %d\n",
>  				      plane_req->crtc_id);
>  			return -ENOENT;
> -- 
> 2.6.6
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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


More information about the dri-devel mailing list