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>
This commit is contained in:
Eric Anholt 2020-12-01 13:47:28 -08:00 committed by Marge Bot
parent daaf5f1d18
commit d3c67d7e7e

View file

@ -512,6 +512,7 @@ fd6_rebind_resource(struct fd_context *ctx, struct fd_resource *rsc)
for (unsigned i = 0; i < ARRAY_SIZE(state->key.view); i++) {
if (rsc->seqno == state->key.view[i].rsc_seqno) {
remove_tex_entry(fd6_ctx, entry);
break;
}
}
}