asahi: Fix memory unsafety in delete_sampler_state

The type is wrong, masked by a void*, meaning the free is completely
wrong. ASan is rightfully unhappy. Fixes crashes destroying the context.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14901>
This commit is contained in:
Alyssa Rosenzweig 2022-02-06 15:44:35 -05:00
parent 786871c87e
commit 0299600efb
1 changed files with 2 additions and 2 deletions

View File

@ -367,8 +367,8 @@ agx_create_sampler_state(struct pipe_context *pctx,
static void
agx_delete_sampler_state(struct pipe_context *ctx, void *state)
{
struct agx_bo *bo = state;
agx_bo_unreference(bo);
struct agx_sampler_state *so = state;
agx_bo_unreference(so->desc);
}
static void