venus: fix a cmd tmp storage leak

When the pool is destroyed, cmds are implicitly freed. Cmd level allocs
have to be cleaned up to avoid leak.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
(cherry picked from commit ee3f17ca79)
This commit is contained in:
Yiwei Zhang 2023-07-04 14:44:49 -07:00 committed by Eric Engestrom
parent e887283d70
commit 032ed1f999
2 changed files with 5 additions and 1 deletions

View file

@ -3064,7 +3064,7 @@
"description": "venus: fix a cmd tmp storage leak",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -638,6 +638,10 @@ vn_DestroyCommandPool(VkDevice device,
&pool->command_buffers, head) {
vn_cs_encoder_fini(&cmd->cs);
vn_object_base_fini(&cmd->base);
if (cmd->builder.tmp.data)
vk_free(&cmd->allocator, cmd->builder.tmp.data);
vk_free(alloc, cmd);
}