diff --git a/.pick_status.json b/.pick_status.json index 82612580b52..78bb2d94324 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -34,7 +34,7 @@ "description": "panfrost: fix potential memory leak", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5a928f7563af8ed18617210b95208ea63c157e2f", "notes": null diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 2029a1cccc1..95f836b2cba 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -1672,9 +1672,10 @@ panfrost_pack_afbc(struct panfrost_context *ctx, unsigned old_size = panfrost_bo_size(prsrc->bo); unsigned ratio = 100 * new_size / old_size; - if (ratio > screen->max_afbc_packing_ratio) + if (ratio > screen->max_afbc_packing_ratio) { + panfrost_bo_unreference(metadata_bo); return; - + } perf_debug(ctx, "%i%%: %i KB -> %i KB\n", ratio, old_size / 1024, new_size / 1024);