[PATCH 1/3] gpu: drm: vmwgfx: Fix memory leak by adding drm_ht_remove()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



drm_ht_remove() should be called in vmw_compat_shader_man_destroy()
This is because memory was allocated for (&man->shaders)->table by
vmw_compat_shader_man_create() -> drm_ht_create()
but this memory is not freed when vmw_compat_shader_mager is destroied.

Signed-off-by: Masaru Nomura <massa.nomura@xxxxxxxxx>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
index c1559eea..01cc8ea 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
@@ -806,6 +806,8 @@ void vmw_compat_shader_man_destroy(struct vmw_compat_shader_manager *man)
 	list_for_each_entry_safe(entry, next, &man->list, head)
 		vmw_compat_shader_free(man, entry);
 
+	drm_ht_remove(&man->shaders);
+
 	mutex_unlock(&man->dev_priv->cmdbuf_mutex);
 	kfree(man);
 }
-- 
1.9.3

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux