diff mbox series

drm/vgem: add missing mutex_destroy

Message ID 20230202125517.427976-1-mcanal@igalia.com (mailing list archive)
State New, archived
Headers show
Series drm/vgem: add missing mutex_destroy | expand

Commit Message

Maíra Canal Feb. 2, 2023, 12:55 p.m. UTC
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@igalia.com>
---
 drivers/gpu/drm/vgem/vgem_fence.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stanislaw Gruszka Feb. 2, 2023, 2:36 p.m. UTC | #1
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@igalia.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@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
>
diff mbox series

Patch

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);
 }