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

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

vc4: replace opencoded slab_zalloc

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

---

 src/gallium/drivers/vc4/vc4_resource.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_resource.c 
b/src/gallium/drivers/vc4/vc4_resource.c
index 84c36bbc30a..9b20e270067 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -153,14 +153,12 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
                 rsc->initialized_buffers = ~0;
         }
 
-        trans = slab_alloc(&vc4->transfer_pool);
+        trans = slab_zalloc(&vc4->transfer_pool);
         if (!trans)
                 return NULL;
 
         /* XXX: Handle DONTBLOCK, DISCARD_RANGE, PERSISTENT, COHERENT. */
 
-        /* slab_alloc_st() doesn't zero: */
-        memset(trans, 0, sizeof(*trans));
         ptrans = &trans->base;
 
         pipe_resource_reference(&ptrans->resource, prsc);

Reply via email to