Commit 0b70743d authored by Eric Auger's avatar Eric Auger Committed by Peter Maydell
Browse files

hw/vfio/platform: replace g_malloc0_n by g_new0



g_malloc0_n() is introduced since glib-2.24 while QEMU currently
requires glib-2.22. This may cause a link error on some distributions.

Signed-off-by: default avatarEric Auger <eric.auger@linaro.org>
Reviewed-by: default avatarGonglei <arei.gonglei@huawei.com>
Acked-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 169b7133
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -346,8 +346,7 @@ static int vfio_populate_device(VFIODevice *vbasedev)
        return ret;
    }

    vdev->regions = g_malloc0_n(vbasedev->num_regions,
                                sizeof(VFIORegion *));
    vdev->regions = g_new0(VFIORegion *, vbasedev->num_regions);

    for (i = 0; i < vbasedev->num_regions; i++) {
        struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };