Module: Mesa
Branch: main
Commit: 06b72f1e1afd58e8f721c327a36f8d38e72982a7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=06b72f1e1afd58e8f721c327a36f8d38e72982a7

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Tue Mar  8 11:55:45 2022 +0100

lima: replace opencoded slab_zalloc

Acked-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>

---

 src/gallium/drivers/lima/lima_resource.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/lima/lima_resource.c 
b/src/gallium/drivers/lima/lima_resource.c
index 3356db9a49d..edd14cf80e5 100644
--- a/src/gallium/drivers/lima/lima_resource.c
+++ b/src/gallium/drivers/lima/lima_resource.c
@@ -657,11 +657,10 @@ lima_transfer_map(struct pipe_context *pctx,
    if (!lima_bo_map(bo))
       return NULL;
 
-   trans = slab_alloc(&ctx->transfer_pool);
+   trans = slab_zalloc(&ctx->transfer_pool);
    if (!trans)
       return NULL;
 
-   memset(trans, 0, sizeof(*trans));
    ptrans = &trans->base;
 
    pipe_resource_reference(&ptrans->resource, pres);

Reply via email to