From patchwork Thu Jun 11 07:14:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 49734 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 42F2720C81 for ; Thu, 11 Jun 2015 07:15:16 +0000 (UTC) Received: by wgla2 with SMTP id a2sf17450289wgl.1 for ; Thu, 11 Jun 2015 00:15:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=zKS7ISa/QAN19JyW5S2nvINlk6Pa9uzYfQIsQwaF1Z0=; b=YqGXdMnah8UkY8zAiO4rVThIYYhZL6iym5pooCJVFkCeGBN1h16D2gK1NBeUh46jGL l4z+QoRYYVET6dAiLVVI2WFcSVjioja+i1WkS8c0LnAtHwlLcJnYz5lbOsIA0/uhZM4z 7Va+g8CuElaO8/twYD7vOYUo7DHSg05GQlLXg4at//wTYkfUmURqRAqRHubeU0xGtHIK msRiBtuTDwbB/FelZ9+QJkaekcEnZ5Snw0UksL5/kvjLHc07jl01uLR3KUe9EXo+172b dkQovjWh5V+5kLJXI/vyNarcnQhDk/HtBYaAQMwy/4U4cNjHqUYAwiDefnLoYxV122TX XeYg== X-Gm-Message-State: ALoCoQm9fsDlAyeRFt+ZSfJD6cBetuQCUuPfyMh8vV8z4L3axH9z4kf5pOmw7F+gNRFi875Vh23M X-Received: by 10.112.159.41 with SMTP id wz9mr6968593lbb.17.1434006915496; Thu, 11 Jun 2015 00:15:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.71 with SMTP id la7ls339654lab.25.gmail; Thu, 11 Jun 2015 00:15:15 -0700 (PDT) X-Received: by 10.152.164.193 with SMTP id ys1mr8284776lab.65.1434006915333; Thu, 11 Jun 2015 00:15:15 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id ug12si11391717lac.47.2015.06.11.00.15.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 00:15:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbcue7 with SMTP id ue7so39782173lbc.0 for ; Thu, 11 Jun 2015 00:15:15 -0700 (PDT) X-Received: by 10.112.41.196 with SMTP id h4mr8313363lbl.36.1434006915186; Thu, 11 Jun 2015 00:15:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3829296lbb; Thu, 11 Jun 2015 00:15:14 -0700 (PDT) X-Received: by 10.140.41.134 with SMTP id z6mr9110430qgz.40.1434006914094; Thu, 11 Jun 2015 00:15:14 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 128si11170941qhs.23.2015.06.11.00.15.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Jun 2015 00:15:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:43513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2whk-0005b5-HG for patch@linaro.org; Thu, 11 Jun 2015 03:15:12 -0400 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) X-Received: by 10.194.185.236 with SMTP id ff12mr14003806wjc.134.1434006882613; Thu, 11 Jun 2015 00:14:42 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id i14sm17920270wjr.7.2015.06.11.00.14.41 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Jun 2015 00:14:41 -0700 (PDT) From: Eric Auger 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 Date: Thu, 11 Jun 2015 08:14:27 +0100 Message-Id: <1434006867-19701-1-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.180 Subject: [Qemu-devel] [PATCH] hw/vfio/platform: replace g_malloc0_n by g_malloc0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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) };