From 6fb52ba30eaf3aa1fa516eb00bbffcf1a2914d01 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 8 Mar 2022 11:46:38 +0100 Subject: [PATCH] zink: replace opencoded slab_zalloc Acked-By: Mike Blumenkrantz Acked-by: Emma Anholt Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/zink_resource.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 2c39ef14e15..a4ab94fdad8 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -1352,15 +1352,14 @@ create_transfer(struct zink_context *ctx, struct pipe_resource *pres, unsigned u struct zink_transfer *trans; if (usage & PIPE_MAP_THREAD_SAFE) - trans = malloc(sizeof(*trans)); + trans = calloc(1, sizeof(*trans)); else if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC) - trans = slab_alloc(&ctx->transfer_pool_unsync); + trans = slab_zalloc(&ctx->transfer_pool_unsync); else - trans = slab_alloc(&ctx->transfer_pool); + trans = slab_zalloc(&ctx->transfer_pool); if (!trans) return NULL; - memset(trans, 0, sizeof(*trans)); pipe_resource_reference(&trans->base.b.resource, pres); trans->base.b.usage = usage;