From nobody Sat Apr 27 17:54:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501247594683736.1818410664621; Fri, 28 Jul 2017 06:13:14 -0700 (PDT) Received: from localhost ([::1]:48344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db54o-0008IB-10 for importer@patchew.org; Fri, 28 Jul 2017 09:13:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db53n-0007fW-Es for qemu-devel@nongnu.org; Fri, 28 Jul 2017 09:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db53m-00048M-H2 for qemu-devel@nongnu.org; Fri, 28 Jul 2017 09:12:07 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::7]:30955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db53k-00046A-8Q; Fri, 28 Jul 2017 09:12:04 -0400 Received: from sender ([2001:a61:1044:dcff:dad:940f:f4ac:9814]) by smtp.strato.de (RZmta 41.1 AUTH) with ESMTPSA id e0433dt6SDBxWad (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 28 Jul 2017 15:11:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1501247522; l=814; s=domk; d=aepfle.de; h=Date:Subject:Cc:To:From; bh=wdkMifzkZBHsRG5k/4gcizfSEx7LqatH5qzq5Z/1Lt0=; b=xmxB/+JGjsd9325hg2XwMlZKA2Mc1+772lQ6t0NuPGkO25tVQv96zTrOEGFDLEfKz/ yKn7rCU+Lqg6AgXdzJ4S8GoQ7QL6brFLPISkAgHsgrSM5trIJz7Xf2o5HgM0oJGayDVr 9liYIFur7PIoAndn+bb2NBtaIUu0ZoQMEvQnk= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnAYQ78nDBeZKUqR2JOG6DB8E6blGGIfEYe8p7s53wH X-RZG-CLASS-ID: mo00 From: Olaf Hering To: Stefano Stabellini , Anthony Perard , Kevin Wolf , Max Reitz , xen-devel@lists.xenproject.org (open list:X86), qemu-block@nongnu.org (open list:Block layer core), qemu-devel@nongnu.org (open list:All patches CC here) Date: Fri, 28 Jul 2017 15:11:51 +0200 Message-Id: <20170728131151.4802-1-olaf@aepfle.de> X-Mailer: git-send-email 2.13.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2a01:238:20a:202:5300::7 Subject: [Qemu-devel] [PATCH v2] xen-disk: use g_new0 to fix build X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Olaf Hering Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" g_malloc0_n is available since glib-2.24. To allow build with older glib versions use the generic g_new0, which is already used in many other places in the code. Fixes commit 3284fad728 ("xen-disk: add support for multi-page shared rings= ") Signed-off-by: Olaf Hering Reviewed-by: Eric Blake Reviewed-by: Stefano Stabellini --- hw/block/xen_disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index d42ed7070d..536e2ee735 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1232,7 +1232,7 @@ static int blk_connect(struct XenDevice *xendev) return -1; } =20 - domids =3D g_malloc0_n(blkdev->nr_ring_ref, sizeof(uint32_t)); + domids =3D g_new0(uint32_t, blkdev->nr_ring_ref); for (i =3D 0; i < blkdev->nr_ring_ref; i++) { domids[i] =3D blkdev->xendev.dom; }