[PATCH] drm/vgem: add missing mutex_destroy

Stanislaw Gruszka stanislaw.gruszka at linux.intel.com
Thu Feb 2 14:36:15 UTC 2023


On Thu, Feb 02, 2023 at 09:55:17AM -0300, Maíra Canal wrote:
> vgem_fence_open() instantiates a mutex for a particular fence
> instance, but never destroys it by calling mutex_destroy() in
> vgem_fence_close().
> 
> So, add the missing mutex_destroy() to guarantee proper resource
> destruction.
> 
> Signed-off-by: Maíra Canal <mcanal at igalia.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka at linux.intel.com>

> ---
>  drivers/gpu/drm/vgem/vgem_fence.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
> index c2a879734d40..e15754178395 100644
> --- a/drivers/gpu/drm/vgem/vgem_fence.c
> +++ b/drivers/gpu/drm/vgem/vgem_fence.c
> @@ -249,4 +249,5 @@ void vgem_fence_close(struct vgem_file *vfile)
>  {
>  	idr_for_each(&vfile->fence_idr, __vgem_fence_idr_fini, vfile);
>  	idr_destroy(&vfile->fence_idr);
> +	mutex_destroy(&vfile->fence_mutex);
>  }
> -- 
> 2.39.1
> 


More information about the dri-devel mailing list