From: Marek Olšák Date: Sat, 23 Jun 2018 05:39:02 +0000 (-0400) Subject: radeonsi: don't use malloc in si_generate_gs_copy_shader X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c554bc5d5f5bc181d157811abd074c033c8cf6f;p=mesa.git radeonsi: don't use malloc in si_generate_gs_copy_shader --- 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;