From 1e5eb79d9a7464482189d7ee8c0f495a31b7f0a3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Aug 2016 14:30:41 -0600 Subject: [PATCH] svga: avoid a calloc in svga_buffer_transfer_map() Just initialize the two other pipe_transfer fields explicitly. Reviewed-by: Charmaine Lee --- src/gallium/drivers/svga/svga_resource_buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.30.2