From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2whM-0005JW-81 for qemu-devel@nongnu.org; Thu, 11 Jun 2015 03:14:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2whH-0006bG-9b for qemu-devel@nongnu.org; Thu, 11 Jun 2015 03:14:48 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:36722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2whH-0006b6-3t for qemu-devel@nongnu.org; Thu, 11 Jun 2015 03:14:43 -0400 Received: by wigg3 with SMTP id g3so66941978wig.1 for ; Thu, 11 Jun 2015 00:14:42 -0700 (PDT) From: Eric Auger Date: Thu, 11 Jun 2015 08:14:27 +0100 Message-Id: <1434006867-19701-1-git-send-email-eric.auger@linaro.org> Subject: [Qemu-devel] [PATCH] hw/vfio/platform: replace g_malloc0_n by g_malloc0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, alex.williamson@redhat.com, peter.maydell@linaro.org, arei.gonglei@huawei.com 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: Eric Auger --- hw/vfio/platform.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 35266a8..c0acc8b 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -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_malloc0(vbasedev->num_regions * sizeof(VFIORegion *)); for (i = 0; i < vbasedev->num_regions; i++) { struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) }; -- 1.8.3.2