From: Brian Paul Date: Tue, 2 Aug 2016 20:30:41 +0000 (-0600) Subject: svga: avoid a calloc in svga_buffer_transfer_map() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e5eb79d9a7464482189d7ee8c0f495a31b7f0a3;p=mesa.git svga: avoid a calloc in svga_buffer_transfer_map() Just initialize the two other pipe_transfer fields explicitly. Reviewed-by: Charmaine Lee --- 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;