From 0c554bc5d5f5bc181d157811abd074c033c8cf6f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 23 Jun 2018 01:39:02 -0400 Subject: [PATCH] radeonsi: don't use malloc in si_generate_gs_copy_shader --- src/gallium/drivers/radeonsi/si_shader.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 74a1855c976..c6b91ba5cf3 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -5728,20 +5728,14 @@ si_generate_gs_copy_shader(struct si_screen *sscreen, struct si_shader_context ctx; struct si_shader *shader; LLVMBuilderRef builder; - struct si_shader_output_values *outputs; + struct si_shader_output_values outputs[SI_MAX_VS_OUTPUTS]; struct tgsi_shader_info *gsinfo = &gs_selector->info; int i, r; - outputs = MALLOC(gsinfo->num_outputs * sizeof(outputs[0])); - - if (!outputs) - return NULL; shader = CALLOC_STRUCT(si_shader); - if (!shader) { - FREE(outputs); + if (!shader) return NULL; - } /* We can leave the fence as permanently signaled because the GS copy * shader only becomes visible globally after it has been compiled. */ @@ -5860,8 +5854,6 @@ si_generate_gs_copy_shader(struct si_screen *sscreen, si_llvm_dispose(&ctx); - FREE(outputs); - if (r != 0) { FREE(shader); shader = NULL; -- 2.30.2