From: Erik Faye-Lund Date: Wed, 5 Sep 2018 11:50:18 +0000 (+0100) Subject: virgl: free trans on map-error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;ds=sidebyside;h=9635869d735f44e381788f47585b4eb8ef124683;p=mesa.git 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 --- 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; }