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

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

d3d12: replace opencoded slab_zalloc

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

---

 src/gallium/drivers/d3d12/d3d12_resource.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp 
b/src/gallium/drivers/d3d12/d3d12_resource.cpp
index ad1af0ad170..9d7669ca165 100644
--- a/src/gallium/drivers/d3d12/d3d12_resource.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp
@@ -1247,12 +1247,11 @@ d3d12_transfer_map(struct pipe_context *pctx,
 
    slab_child_pool* transfer_pool = (usage & TC_TRANSFER_MAP_THREADED_UNSYNC) ?
       &ctx->transfer_pool_unsync : &ctx->transfer_pool;
-   struct d3d12_transfer *trans = (struct d3d12_transfer 
*)slab_alloc(transfer_pool);
+   struct d3d12_transfer *trans = (struct d3d12_transfer 
*)slab_zalloc(transfer_pool);
    struct pipe_transfer *ptrans = &trans->base.b;
    if (!trans)
       return NULL;
 
-   memset(trans, 0, sizeof(*trans));
    pipe_resource_reference(&ptrans->resource, pres);
 
    ptrans->resource = pres;

Reply via email to