From: Mike Blumenkrantz Date: Mon, 10 Jul 2023 18:37:34 +0000 (-0400) Subject: nouveau: calloc vertex csos X-Git-Tag: upstream/23.3.3~3379 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29fd7bf603f08d81b8f83afda395948f2bd38d9a;p=platform%2Fupstream%2Fmesa.git nouveau: calloc vertex csos Part-of: --- diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c index 22e309e..a67363e 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 15645f9..d71e1d5 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 c971702..1d6b1ea 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;