panfrost: Fix panfrost_bo_access memory leak

The bo access needs to be freed prior to removing it from its hash
table. This prevents leaking them over time.

Signed-off-by: Daniel Ogorchock <daniel.ogorchock@garmin.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3308>
This commit is contained in:
Daniel Ogorchock
2020-01-06 17:33:49 -06:00
committed by Tomeu Vizoso
parent ecace26853
commit 2848edc0ef
+3 -1
View File
@@ -380,8 +380,10 @@ panfrost_gc_fences(struct panfrost_context *ctx)
panfrost_bo_access_gc_fences(ctx, access, entry->key);
if (!util_dynarray_num_elements(&access->readers,
struct panfrost_batch_fence *) &&
!access->writer)
!access->writer) {
ralloc_free(access);
_mesa_hash_table_remove(ctx->accessed_bos, entry);
}
}
}