mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 06:30:11 +01:00
etnaviv: fix read staging buffer leak
Currently we only free a potentially allocated staging buffer when the mapping is a write mapping, but staging buffers can also be allocated for read mappings. Fix the read staging buffer leaks by always freeing the staging buffer. Closes #9967 Cc: mesa-stable Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25646>
This commit is contained in:
parent
c619d9c1b6
commit
aeb6584ecd
1 changed files with 1 additions and 2 deletions
|
|
@ -153,8 +153,6 @@ etna_transfer_unmap(struct pipe_context *pctx, struct pipe_transfer *ptrans)
|
|||
} else {
|
||||
BUG("unsupported tiling %i", rsc->layout);
|
||||
}
|
||||
|
||||
FREE(trans->staging);
|
||||
}
|
||||
|
||||
if (ptrans->resource->target == PIPE_BUFFER)
|
||||
|
|
@ -179,6 +177,7 @@ etna_transfer_unmap(struct pipe_context *pctx, struct pipe_transfer *ptrans)
|
|||
if (!trans->rsc && !(ptrans->usage & PIPE_MAP_UNSYNCHRONIZED))
|
||||
etna_bo_cpu_fini(rsc->bo);
|
||||
|
||||
FREE(trans->staging);
|
||||
pipe_resource_reference(&trans->rsc, NULL);
|
||||
pipe_resource_reference(&ptrans->resource, NULL);
|
||||
slab_free(&ctx->transfer_pool, trans);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue