From 9635869d735f44e381788f47585b4eb8ef124683 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 5 Sep 2018 12:50:18 +0100 Subject: [PATCH] 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 Reviewed-by: Dave Airlie --- src/gallium/drivers/virgl/virgl_texture.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.30.2