[Mesa-dev] [PATCH] radv: fix a memleak for merged shaders on GFX9

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Fri Jul 20 21:37:53 UTC 2018


CC stable?

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>


On Fri, Jul 20, 2018 at 6:48 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> modules[i] can be NULL for merged shaders but we have to
> free the NIR code. radv_can_dump_shader_stats() already handles
> if modules[i] is NULL, no need to check it twice.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_pipeline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
> index 27e13a2251..545b618b7c 100644
> --- a/src/amd/vulkan/radv_pipeline.c
> +++ b/src/amd/vulkan/radv_pipeline.c
> @@ -2160,7 +2160,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
>
>         for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
>                 free(codes[i]);
> -               if (modules[i]) {
> +               if (nir[i]) {
>                         if (!pipeline->device->keep_shader_info)
>                                 ralloc_free(nir[i]);
>
> --
> 2.18.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list