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>
This commit is contained in:
Erik Faye-Lund
2018-09-05 12:50:18 +01:00
parent 44e3e6a9b4
commit 9635869d73
@@ -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;
}