diff options
author | Eric Anholt <eric@anholt.net> | 2020-12-01 13:47:28 -0800 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2020-12-02 15:10:44 -0800 |
commit | 404c4400156e6807130ac793b89c7bf38bd88cf8 (patch) | |
tree | c5b5f93afbcb6eab858ee1178f5cdc3e0d6f43d7 | |
parent | 01f9a5e82275dfe8ea0df2c480719b199155cd6d (diff) |
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: 6de01faac5a2 ("freedreno/a6xx: invalidate tex state cache entries on rebind")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>
(cherry picked from commit d3c67d7e7ec6b9cf10fbea0d08e92751b7b0fbae)
Conflicts:
src/gallium/drivers/freedreno/a6xx/fd6_texture.c
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_texture.c | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json index d0918e40308..af4ea3f657b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4,7 +4,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" }, diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c index ff408eb334a..73ea52d6a3a 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c @@ -484,6 +484,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; } } } |