]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/vmwgfx: Free hash table allocated by cmdbuf managed res mgr
authorDeepak Rawat <drawat@vmware.com>
Mon, 26 Jun 2017 12:39:08 +0000 (14:39 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Mon, 26 Jun 2017 12:39:08 +0000 (14:39 +0200)
The hash table created during vmw_cmdbuf_res_man_create was
never freed. This causes memory leak in context creation.
Added the corresponding drm_ht_remove in vmw_cmdbuf_res_man_destroy.

Tested for memory leak by running piglit overnight and kernel
memory is not inflated which earlier was.

Cc: <stable@vger.kernel.org>
Signed-off-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c

index 13db8a2851edd475cc1e44adedd44796c3ccbca1..1f013d45c9e9a3959dfa19300ba76fc37820592a 100644 (file)
@@ -321,6 +321,7 @@ void vmw_cmdbuf_res_man_destroy(struct vmw_cmdbuf_res_manager *man)
        list_for_each_entry_safe(entry, next, &man->list, head)
                vmw_cmdbuf_res_free(man, entry);
 
+       drm_ht_remove(&man->resources);
        kfree(man);
 }