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

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

v3d: 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/v3d/v3d_resource.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/v3d/v3d_resource.c 
b/src/gallium/drivers/v3d/v3d_resource.c
index da41872883b..201b3c16066 100644
--- a/src/gallium/drivers/v3d/v3d_resource.c
+++ b/src/gallium/drivers/v3d/v3d_resource.c
@@ -260,14 +260,12 @@ v3d_resource_transfer_map(struct pipe_context *pctx,
 
         v3d_map_usage_prep(pctx, prsc, usage);
 
-        trans = slab_alloc(&v3d->transfer_pool);
+        trans = slab_zalloc(&v3d->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