From 4734c85292cdfbc1ec9adc872d86f05430b8375b Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 22 Jul 2024 14:47:04 -0700 Subject: [PATCH] tgsi_to_nir: free disk cache value if the size is wrong Fixes: 4db880d8057 ("ttn: Implement disk cache") Reviewed-by: Ian Romanick Reviewed-by: Rob Clark Part-of: (cherry picked from commit 11bc95934f7a4418d2b85cdeeb44d902f65e78ec) --- .pick_status.json | 2 +- src/gallium/auxiliary/nir/tgsi_to_nir.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index a5a7ee6363c..cef1b8d0428 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1874,7 +1874,7 @@ "description": "tgsi_to_nir: free disk cache value if the size is wrong", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "4db880d8057bac3209c196edc94c6b1e521a782a", "notes": null diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index a9acd6f0186..44b81b8ae28 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -2600,6 +2600,7 @@ load_nir_from_disk_cache(struct disk_cache *cache, * However we do still check if the first element is indeed the size, * as we cannot fully trust disk_cache_get (EGL_ANDROID_blob_cache) */ if (buffer[0] != size) { + free(buffer); return NULL; }