Commit 746549cf authored by Cody Cheng's avatar Cody Cheng Committed by Tomasz Zawadzki
Browse files

cpuset, bdev_iscsi: fix calloc transposed arguments



GCC 14.1 calloc expects the number of elements before the size of elements.
This corrects the parameter sequence of calloc in cpuset.c and bdev_iscsi.c.

Fixes #3410

Change-Id: Ibc202a207e209c2ec32a089a24aac012b19816c0
Signed-off-by: default avatarCody Cheng <ccheng@iol.unh.edu>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23734


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent db4fc505
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
struct spdk_cpuset *
spdk_cpuset_alloc(void)
{
	return (struct spdk_cpuset *)calloc(sizeof(struct spdk_cpuset), 1);
	return (struct spdk_cpuset *)calloc(1, sizeof(struct spdk_cpuset));
}

void
+1 −1
Original line number Diff line number Diff line
@@ -804,7 +804,7 @@ create_iscsi_lun(struct bdev_iscsi_conn_req *req, uint64_t num_blocks,
	struct bdev_iscsi_lun *lun;
	int rc;

	lun = calloc(sizeof(*lun), 1);
	lun = calloc(1, sizeof(*lun));
	if (!lun) {
		SPDK_ERRLOG("Unable to allocate enough memory for iscsi backend\n");
		return -ENOMEM;