From patchwork Fri Jul 28 12:31:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 9868673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDF9960382 for ; Fri, 28 Jul 2017 12:36:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9A25288E7 for ; Fri, 28 Jul 2017 12:36:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB5DF288E6; Fri, 28 Jul 2017 12:36:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 58B0E288CB for ; Fri, 28 Jul 2017 12:36:01 +0000 (UTC) Received: from localhost ([::1]:48134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4Uq-0004Px-Cm for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Jul 2017 08:36:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4Tu-0004HL-HX for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:35:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db4Tt-0002qh-RN for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:35:02 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::7]:31847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db4Tr-0002md-N8; Fri, 28 Jul 2017 08:34:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1501245297; l=829; s=domk; d=aepfle.de; h=Date:Subject:Cc:To:From; bh=7hny9hJXLWpcnGkH4C+UIi2wsZnJ3lQAPozwMSQdC4Q=; b=eokSQP6UULge1AlzC2nrF6y/4qMa77vTSgo+SfzsCOdIavq5aOijta3qVDeD7zbgTn nr31tg+ba10AHJKpJ9i4lmhhOOGOsxnhLjjBOR7J9wjnlGaK8BlEBuwrtJbQzAdX4tbh t8G57jVUfpydJlt+L4sXfkXKxza3578/oWINw= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnAYQ78nDBeZKUqR2JOG6DB8E6blGGIfEYe8p7s53wH X-RZG-CLASS-ID: mo00 Received: from sender ([2001:a61:1044:dcff:dad:940f:f4ac:9814]) by smtp.strato.de (RZmta 41.1 AUTH) with ESMTPSA id j07b76t6SCVgV2F (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 14:31:42 +0200 (CEST) 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 14:31:27 +0200 Message-Id: <20170728123127.27921-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] xen-disk: use g_malloc0 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP g_malloc0_n is available since glib-2.24. To allow build with older glib versions use the generic g_malloc0, 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 --- 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..71deec17b0 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; } - domids = g_malloc0_n(blkdev->nr_ring_ref, sizeof(uint32_t)); + domids = g_malloc0(blkdev->nr_ring_ref * sizeof(uint32_t)); for (i = 0; i < blkdev->nr_ring_ref; i++) { domids[i] = blkdev->xendev.dom; }