aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_resource_buffer.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-08-02 14:30:41 -0600
committerBrian Paul <[email protected]>2016-08-16 08:24:53 -0600
commit1e5eb79d9a7464482189d7ee8c0f495a31b7f0a3 (patch)
treef72f70e24e2a21524bc3a74c69605068629688ba /src/gallium/drivers/svga/svga_resource_buffer.c
parentf934117bbb9d58f0f5d9cfb4397fec9c6371ed64 (diff)
svga: avoid a calloc in svga_buffer_transfer_map()
Just initialize the two other pipe_transfer fields explicitly. Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_resource_buffer.c')
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c
index c126ff91c90..94788e70e31 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.c
+++ b/src/gallium/drivers/svga/svga_resource_buffer.c
@@ -84,7 +84,7 @@ svga_buffer_transfer_map(struct pipe_context *pipe,
assert(box->height == 1);
assert(box->depth == 1);
- transfer = CALLOC_STRUCT(pipe_transfer);
+ transfer = MALLOC_STRUCT(pipe_transfer);
if (!transfer) {
return NULL;
}
@@ -93,6 +93,8 @@ svga_buffer_transfer_map(struct pipe_context *pipe,
transfer->level = level;
transfer->usage = usage;
transfer->box = *box;
+ transfer->stride = 0;
+ transfer->layer_stride = 0;
if ((usage & PIPE_TRANSFER_READ) && sbuf->dirty) {
enum pipe_error ret;