diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index 765ea1cb074..f6ac01d60db 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -2602,11 +2602,11 @@ nir_to_spirv(struct nir_shader *s, const struct zink_so_info *so_info, size_t num_words = spirv_builder_get_num_words(&ctx.builder); - ret = CALLOC_STRUCT(spirv_shader); + ret = ralloc(NULL, struct spirv_shader); if (!ret) goto fail; - ret->words = MALLOC(sizeof(uint32_t) * num_words); + ret->words = ralloc_size(ret, sizeof(uint32_t) * num_words); if (!ret->words) goto fail; diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 83973c5270f..98df9dfd3fd 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -269,8 +269,7 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, struct z ralloc_free(nir); /* TODO: determine if there's any reason to cache spirv output? */ - free(spirv->words); - free(spirv); + ralloc_free(spirv); return mod; }