From d1123d795e803a8eed7d628c6cfe7e03b004a4d0 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 3 Jun 2024 07:59:54 +1000 Subject: [PATCH] fix bug introduced in using calloc (llama/7701) compilade pointed this out on the previous MR --- ggml-alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml-alloc.c b/ggml-alloc.c index 1fbd376edf4..0146946ebd7 100644 --- a/ggml-alloc.c +++ b/ggml-alloc.c @@ -377,7 +377,7 @@ ggml_gallocr_t ggml_gallocr_new_n(ggml_backend_buffer_type_t * bufts, int n_bufs galloc->bufts = calloc(n_bufs, sizeof(ggml_backend_buffer_type_t)); GGML_ASSERT(galloc->bufts != NULL); - galloc->buffers = calloc(n_bufs, sizeof(ggml_backend_buffer_t) * n_bufs); + galloc->buffers = calloc(n_bufs, sizeof(ggml_backend_buffer_t)); GGML_ASSERT(galloc->buffers != NULL); galloc->buf_tallocs = calloc(n_bufs, sizeof(struct ggml_dyn_tallocr *));