zink: do not overwrite existing error for miptail on uncommit

a7f86e38ca added the call to
sparse_backing_free. It reuses the ok variable and overwrites the
existing value

Fixes: a7f86e38ca
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36467>
(cherry picked from commit b08a23550f)
This commit is contained in:
Thomas H.P. Andersen 2025-07-30 16:06:19 +02:00 committed by Eric Engestrom
parent b4218166be
commit 8a79440ba7
2 changed files with 3 additions and 3 deletions

View file

@ -7864,7 +7864,7 @@
"description": "zink: do not overwrite existing error for miptail on uncommit",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "a7f86e38ca25c844d69b230283deba599dc9c289",
"notes": null

View file

@ -1141,10 +1141,10 @@ zink_bo_commit(struct zink_context *ctx, struct zink_resource *res, unsigned lev
util_dynarray_append(&ctx->bs->tracked_semaphores, VkSemaphore, cur_sem);
else
ok = false;
ok = sparse_backing_free(screen, backing[i]->bo, backing[i], backing_start[i], backing_size[i]);
if (!ok) {
if (!sparse_backing_free(screen, backing[i]->bo, backing[i], backing_start[i], backing_size[i])) {
/* Couldn't allocate tracking data structures, so we have to leak */
fprintf(stderr, "zink: leaking sparse backing memory\n");
ok = false;
}
}
goto out;