From b033b02dd4ad819ed5b0eb82bb9788a11f926d10 Mon Sep 17 00:00:00 2001 From: Bertho Stultiens Date: Sat, 11 Jan 2025 11:10:06 +0100 Subject: [PATCH] Fix transposed arguments in call to calloc(). --- src/hal/user_comps/xhc-hb04.cc | 4 ++-- src/libnml/os_intf/_shm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hal/user_comps/xhc-hb04.cc b/src/hal/user_comps/xhc-hb04.cc index 32e01acf8c3..885c1cd3a3f 100644 --- a/src/hal/user_comps/xhc-hb04.cc +++ b/src/hal/user_comps/xhc-hb04.cc @@ -515,7 +515,7 @@ static void quit(int sig) static int hal_pin_simu(char *pin_name, void **ptr, int s) { printf("Creating pin: %s\n", pin_name); - *ptr = calloc(s, 1); + *ptr = calloc(1, s); return 0; } @@ -585,7 +585,7 @@ static void hal_setup() } } else { - xhc.hal = (xhc_hal_t *)calloc(sizeof(xhc_hal_t), 1); + xhc.hal = (xhc_hal_t *)calloc(1, sizeof(xhc_hal_t)); } r = 0; diff --git a/src/libnml/os_intf/_shm.c b/src/libnml/os_intf/_shm.c index fdcac46d8e0..dd30457fbc1 100644 --- a/src/libnml/os_intf/_shm.c +++ b/src/libnml/os_intf/_shm.c @@ -189,7 +189,7 @@ shm_t *rcs_shm_open(key_t key, size_t size, int oflag, /* int mode */ ...) shmflg |= IPC_CREAT; } - shm = (shm_t *) calloc(sizeof(shm_t), 1); + shm = (shm_t *) calloc(1, sizeof(shm_t)); if (NULL == shm) { rcs_print_error("rcs_shm_open: calloc failed\n"); return NULL;