Skip to contentSkip to conversation

drm/vgem: add missing mutex_destroy

PATCH In review Maíra Canal 2 participants 2 messages Feb 2, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vgem: add missing mutex_destroy

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.

---
 drivers/gpu/drm/vgem/vgem_fence.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/vgem/vgem_fence.c +1 -0
index c2a879734d40..e15754178395 100644
@@ -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);
 }
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Maíra Canal

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.

Quoted 17 lines
---
 drivers/gpu/drm/vgem/vgem_fence.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/vgem/vgem_fence.c +1 -0
index c2a879734d40..e15754178395 100644
@@ -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);
 }
Signature · 1 line
2.39.1