From 65cac69a1c438f03bcd62ea36180cfcbe2d9dd1f Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 3 Sep 2025 16:29:42 -0500 Subject: [PATCH] cpukit/libblock/src/bdbuf.c: Fix order of calloc() arguments Address calls to calloc () which swap the number of elements and size of each element argument. --- cpukit/libblock/src/bdbuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c index 4fc68dcc9f..1ebf2a3d06 100644 --- a/cpukit/libblock/src/bdbuf.c +++ b/cpukit/libblock/src/bdbuf.c @@ -1353,16 +1353,16 @@ rtems_bdbuf_do_init (void) /* * Allocate the memory for the buffer descriptors. */ - bdbuf_cache.bds = calloc (sizeof (rtems_bdbuf_buffer), - bdbuf_cache.buffer_min_count); + bdbuf_cache.bds = calloc (bdbuf_cache.buffer_min_count, + sizeof (rtems_bdbuf_buffer)); if (!bdbuf_cache.bds) goto error; /* * Allocate the memory for the buffer descriptors. */ - bdbuf_cache.groups = calloc (sizeof (rtems_bdbuf_group), - bdbuf_cache.group_count); + bdbuf_cache.groups = calloc (bdbuf_cache.group_count, + sizeof (rtems_bdbuf_group)); if (!bdbuf_cache.groups) goto error;