summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-04-04 12:36:08 +0200
committerErik Faye-Lund <[email protected]>2019-04-17 07:27:08 +0000
commit1f27bd3f2be06ff6e5d795dd115fb94144971785 (patch)
tree14747bb115274c8b7bf81252222a0be591032a80 /src
parentfc8b1ca33a17c67b9b8cb1af5a30b46718237011 (diff)
virgl: return error if allocating resolve_tmp fails
Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index d52062579d4..398d2ef9d4e 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -135,6 +135,10 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
virgl_init_temp_resource_from_box(&templ, resource, box, level, 0);
trans->resolve_tmp = (struct virgl_resource *)ctx->screen->resource_create(ctx->screen, &templ);
+ if (!trans->resolve_tmp) {
+ virgl_resource_destroy_transfer(&vctx->transfer_pool, trans);
+ return NULL;
+ }
virgl_copy_region_with_blit(ctx, &trans->resolve_tmp->u.b, 0, 0, 0, 0, resource, level, box);
ctx->flush(ctx, NULL, 0);