summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2018-09-05 12:50:18 +0100
committerErik Faye-Lund <erik.faye-lund@collabora.com>2018-09-10 10:35:02 +0200
commit9635869d735f44e381788f47585b4eb8ef124683 (patch)
treec60bb0d7ef3c57df7819e2656e83e186d4890fd2
parent44e3e6a9b403f9325f49684b9baed1854da30cec (diff)
virgl: free trans on map-error
When we fail to map memory, we should also free trans to avoid leaking memory. Noticed while reading code. Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 150a5ebd8c7..71c0e9da7fd 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -195,6 +195,7 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
ptr = vs->vws->resource_map(vs->vws, hw_res);
if (!ptr) {
+ slab_free(&vctx->texture_transfer_pool, trans);
return NULL;
}