summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/radeon/r600_buffer_common.c
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-04-13 10:55:29 -0500
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-04-14 16:29:23 -0500
commita17911ceb11fbf14b296095a9b5c506295b73d99 (patch)
treee6d4d7715e74e2cb4b22da23a4db0fc3aac9612e /src/gallium/drivers/radeon/r600_buffer_common.c
parent8bd0f0df50235fc5c3c556b9e20cb0225580596a (diff)
gallium/radeon: handle failure when mapping staging buffer
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_buffer_common.c')
-rw-r--r--src/gallium/drivers/radeon/r600_buffer_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index 47514e91d2..664dc5bfdc 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -376,6 +376,10 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
0, 0, resource, level, box);
data = r600_buffer_map_sync_with_rings(rctx, staging, PIPE_TRANSFER_READ);
+ if (!data) {
+ pipe_resource_reference((struct pipe_resource **)&staging, NULL);
+ return NULL;
+ }
data += box->x % R600_MAP_BUFFER_ALIGNMENT;
return r600_buffer_get_transfer(ctx, resource, level, usage, box,