Module: Mesa Branch: main Commit: 79f4e33f04bfbb2bda67ab6f12b4ceabe1d85a60 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=79f4e33f04bfbb2bda67ab6f12b4ceabe1d85a60
Author: Iago Toral Quiroga <[email protected]> Date: Mon May 9 09:14:28 2022 +0200 v3dv: don't leak variant QPU when pipeline compile fails Typically we free them when we upload the QPU code from the variant to the assembly BO in the pipeline, however, if there is an error during pipeline compilation that may not happen and we would leak the QPU code from the variants. Reviewed-by: Alejandro PiƱeiro <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16370> --- src/broadcom/vulkan/v3dv_pipeline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index f2c6dac319d..c3dbac57227 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -94,6 +94,8 @@ v3dv_shader_variant_destroy(struct v3dv_device *device, /* The assembly BO is shared by all variants in the pipeline, so it can't * be freed here and should be freed with the pipeline */ + if (variant->qpu_insts) + free(variant->qpu_insts); ralloc_free(variant->prog_data.base); vk_free(&device->vk.alloc, variant); }
