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

Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Jul 10 14:37:34 2023 -0400

nouveau: calloc vertex csos

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24117>

---

 src/gallium/drivers/nouveau/nv30/nv30_vbo.c | 2 +-
 src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c 
b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
index 22e309eb773..a67363e096c 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
@@ -262,7 +262,7 @@ nv30_vertex_state_create(struct pipe_context *pipe, 
unsigned num_elements,
     struct translate_key transkey;
     unsigned i;
 
-    so = MALLOC(sizeof(*so) + sizeof(*so->element) * num_elements);
+    so = CALLOC(1, sizeof(*so) + sizeof(*so->element) * num_elements);
     if (!so)
         return NULL;
     memcpy(so->pipe, elements, sizeof(*elements) * num_elements);
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c 
b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
index 15645f94705..d71e1d559f5 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
@@ -54,7 +54,7 @@ nv50_vertex_state_create(struct pipe_context *pipe,
     struct translate_key transkey;
     unsigned i;
 
-    so = MALLOC(sizeof(*so) +
+    so = CALLOC(1, sizeof(*so) +
                 num_elements * sizeof(struct nv50_vertex_element));
     if (!so)
         return NULL;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
index c9717020953..1d6b1ead57c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
@@ -56,7 +56,7 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
     unsigned i;
     unsigned src_offset_max = 0;
 
-    so = MALLOC(sizeof(*so) +
+    so = CALLOC(1, sizeof(*so) +
                 num_elements * sizeof(struct nvc0_vertex_element));
     if (!so)
         return NULL;

Reply via email to