aboutsummaryrefslogtreecommitdiff
path: root/lib/libvfio-user.c
diff options
context:
space:
mode:
authorMichal Berger <michallinuxstuff@gmail.com>2024-08-16 18:23:32 +0200
committerGitHub <noreply@github.com>2024-08-16 17:23:32 +0100
commita5fca05211a15743ecbc5b375048325d2746d758 (patch)
tree3de15fccef3b91abb8a59816cdac9c008ee1b3cb /lib/libvfio-user.c
parentf468169e322ce258621de97f1e7d47a0b7487d3f (diff)
downloadlibvfio-user-a5fca05211a15743ecbc5b375048325d2746d758.zip
libvfio-user-a5fca05211a15743ecbc5b375048325d2746d758.tar.gz
libvfio-user-a5fca05211a15743ecbc5b375048325d2746d758.tar.bz2
lib/libvfio-user: Fix calloc-transposed-args reported by gcc >= 14 (#802)
Fixes issue #801. Signed-off-by: Michal Berger <michal.berger@intel.com>
Diffstat (limited to 'lib/libvfio-user.c')
-rw-r--r--lib/libvfio-user.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index 62efd30..1ff8aa0 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -624,8 +624,7 @@ handle_device_get_region_io_fds(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg)
msg->out.nr_fds = 0;
if (max_sent_sub_regions > 0 && req->argsz >= reply->argsz) {
- msg->out.fds = calloc(sizeof(int),
- max_sent_sub_regions + nr_shadow_reg);
+ msg->out.fds = calloc(max_sent_sub_regions + nr_shadow_reg, sizeof(int));
if (msg->out.fds == NULL) {
return -1;
}