panfrost: Fix headers and gpu_headers memory leak
authorDaniel Ogorchock <daniel.ogorchock@garmin.com>
Tue, 7 Jan 2020 16:07:37 +0000 (10:07 -0600)
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>
Mon, 13 Jan 2020 09:11:35 +0000 (09:11 +0000)
The per-batch headers/gpu_headers dynarrays need to be freed during the
batch cleanup to prevent leaking.

Signed-off-by: Daniel Ogorchock <daniel.ogorchock@garmin.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3308>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3308>

src/gallium/drivers/panfrost/pan_job.c

index d1ce9c0ec3338925417573112361ce73d343d9b8..1b7d370b9982f7dda2d3fca9f60b3f8bd7f05bd1 100644 (file)
@@ -181,6 +181,9 @@ panfrost_free_batch(struct panfrost_batch *batch)
                 panfrost_batch_fence_unreference(*dep);
         }
 
+        util_dynarray_fini(&batch->headers);
+        util_dynarray_fini(&batch->gpu_headers);
+
         /* The out_sync fence lifetime is different from the the batch one
          * since other batches might want to wait on a fence of already
          * submitted/signaled batch. All we need to do here is make sure the