freedreno: Break out of "should we free the entry" loop once we've freed.

Fixes a use-after-free of the state on the next iteration when it was
probably just destroyed.

Fixes: 6de01faac5 ("freedreno/a6xx: invalidate tex state cache entries on rebind")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>
(cherry picked from commit d3c67d7e7e)
This commit is contained in:
Eric Anholt 2020-12-01 13:47:28 -08:00 committed by Dylan Baker
parent 5f9912a4dd
commit fbc6a5280f
2 changed files with 2 additions and 1 deletions

View file

@ -229,7 +229,7 @@
"description": "freedreno: Break out of \"should we free the entry\" loop once we've freed.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "6de01faac5a20208422fb75d22f2bd88c53f53d8"
},

View file

@ -450,6 +450,7 @@ fd6_rebind_resource(struct fd_context *ctx, struct fd_resource *rsc)
if (rsc->seqno == state->key.view[i].rsc_seqno) {
fd6_texture_state_destroy(entry->data);
_mesa_hash_table_remove(fd6_ctx->tex_cache, entry);
break;
}
}
}