pan/midgard: Fix bundle dynarray leak
authorIcecream95 <ixn@keemail.me>
Tue, 21 Jan 2020 21:43:23 +0000 (10:43 +1300)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 19:35:09 +0000 (19:35 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3496>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3496>

src/panfrost/midgard/midgard_schedule.c

index 59efeb5a4f76598000947d28fe29aefb3dde1557..bc71533ed9d4ad43384c759a3212d73894e6615e 100644 (file)
@@ -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