From f8eb4441ae3e40141d5f11fb1abf4c0f9e2aa26e Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Wed, 22 Jan 2020 10:43:23 +1300 Subject: [PATCH] pan/midgard: Fix bundle dynarray leak Reviewed-by: Alyssa Rosenzweig Tested-by: Marge Bot Part-of: --- src/panfrost/midgard/midgard_schedule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 59efeb5a4f7..bc71533ed9d 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -1092,10 +1092,11 @@ schedule_block(compiler_context *ctx, midgard_block *block) /* We emitted bundles backwards; copy into the block in reverse-order */ - util_dynarray_init(&block->bundles, NULL); + util_dynarray_init(&block->bundles, block); util_dynarray_foreach_reverse(&bundles, midgard_bundle, bundle) { util_dynarray_append(&block->bundles, midgard_bundle, *bundle); } + util_dynarray_fini(&bundles); /* Blend constant was backwards as well. blend_offset if set is * strictly positive, as an offset of zero would imply constants before -- 2.30.2