* [PATCH] drm/vgem: add missing mutex_destroy
@ 2023-02-02 12:55 Maíra Canal
2023-02-02 14:36 ` Stanislaw Gruszka
0 siblings, 1 reply; 2+ messages in thread
From: Maíra Canal @ 2023-02-02 12:55 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, Melissa Wen; +Cc: Maíra Canal, dri-devel
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(+)
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/vgem: add missing mutex_destroy
2023-02-02 12:55 [PATCH] drm/vgem: add missing mutex_destroy Maíra Canal
@ 2023-02-02 14:36 ` Stanislaw Gruszka
0 siblings, 0 replies; 2+ messages in thread
From: Stanislaw Gruszka @ 2023-02-02 14:36 UTC (permalink / raw)
To: Maíra Canal; +Cc: Melissa Wen, dri-devel
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-02 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-02 12:55 [PATCH] drm/vgem: add missing mutex_destroy Maíra Canal
2023-02-02 14:36 ` Stanislaw Gruszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.