From 9020df131fff6ca56c7b43c8725cee4dc559d80c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Aug 2020 19:23:34 -0700 Subject: [PATCH] freedreno: Fix leak of shader binary on disk cache hits. It's supposed to be ralloced -- there's not even a shader variant destroy function for freeing, just ralloc_free() on the ir3_shader_variant or the parent ir3_shader when you're done! Fixes: f97acb4bb4b1 ("freedreno/ir3: disk-cache support") Part-of: (cherry picked from commit 433841d9eb7cd9dd5e00b2f47cd998e0e986ef02) --- .pick_status.json | 2 +- src/freedreno/ir3/ir3_disk_cache.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d0cf4388f30..78b9999346a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1858,7 +1858,7 @@ "description": "freedreno: Fix leak of shader binary on disk cache hits.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "f97acb4bb4b18f127b62aa8eeb57cdf3d8fe3aa2" }, diff --git a/src/freedreno/ir3/ir3_disk_cache.c b/src/freedreno/ir3/ir3_disk_cache.c index a2249f25de3..78726710758 100644 --- a/src/freedreno/ir3/ir3_disk_cache.c +++ b/src/freedreno/ir3/ir3_disk_cache.c @@ -126,7 +126,7 @@ retrieve_variant(struct blob_reader *blob, struct ir3_shader_variant *v) * pointers need special handling: */ - v->bin = malloc(4 * v->info.sizedwords); + v->bin = rzalloc_size(v, 4 * v->info.sizedwords); blob_copy_bytes(blob, v->bin, 4 * v->info.sizedwords); if (!v->binning_pass) {