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.
This commit is contained in:
Joel Sherrill
2025-09-03 16:29:42 -05:00
committed by Gedare Bloom
parent c0fba626cb
commit 65cac69a1c

View File

@@ -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;