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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user