Message ID | 20171006235023.11952-51-f4bug@amsat.org |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kfnMle9l"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86fr6V6Qz9t4P for <incoming@patchwork.ozlabs.org>; Sat, 7 Oct 2017 11:23:16 +1100 (AEDT) Received: from localhost ([::1]:47703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1e0cte-000149-Pi for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:23:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>) id 1e0cQp-0000jI-Gs for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>) id 1e0cQn-0006cB-Tf for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:27 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36748) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>) id 1e0cQn-0006c0-Pe; Fri, 06 Oct 2017 19:53:25 -0400 Received: by mail-qk0-x243.google.com with SMTP id z14so12861450qkg.3; Fri, 06 Oct 2017 16:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O9bKfudW6f8SNHCIhSKJI9NDcD4/xEssUfEFcjfdl6A=; b=kfnMle9lNyryo9JVBRMVPhGOwuU245wLYMNfGtjPtJoaOZpIWmIXqWZpJxK6I1gtE6 GLNscjUSKt1XqM9kZhFfWuu1iLBAo4j7f5o2NcfVJF/C646LSVGiZ+MfcldmxZsbZyQq WS6aig2MGKG7n8y16Jes7vfp+hJNYVYoA9hUM0+x2wUeo92t/e1G42Tk7WpdPrTMqfnS V3JJLLyupraMsnPCWjHVIHnzpSx1TaR0ZqVoopwaccf46IvSKFQFjrf6OvyADTmT2FU5 HvVhAXydeh9c9Rz+Yfz4ohKWMun4tX85Zfnewdb6rh+BmaMFVOIiaHX8jFMBl62b91x9 iGcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=O9bKfudW6f8SNHCIhSKJI9NDcD4/xEssUfEFcjfdl6A=; b=FtxfijK7nejO2alD53INHEQrhrMc1Ncw1wEwebdtivQdf+XmG9sjuQI2NKaNK0EghT SADRBeRwwrcbBRz7DYTeGUGCGi8kfvbs1ynEf6Ry/jlRuq4D+MdLZtejtFFV0KIGEl4Q UFwmsuQ8JIf2n8vXAQCKPjfuOkwfNxNdm17TCJD34B7t1M34JtUZrJsolvI9X6LMLyO0 RJNXVo03Z89qz27gLVzFfZTzzunu9+Wb4sxa79SXIBEAbMM5rH5LjHNKlKO/hH8PYRz3 4kXmG3yJIeYs0QD5Mcv13tEWx2h6LskSCBfwWtkYSs5mL/++OF7O+nRyY73fe12g+nTh oKsg== X-Gm-Message-State: AMCzsaUmLipnDU7adj25rHc5pxcnl1kWo0NwiuY/komjc7v0Bv3lV5cA kY5sBZHUkfu0kgHtq96QXC4= X-Google-Smtp-Source: AOwi7QBIkJxOpkQ7aXI9n0YCVYFfrAGcDE+rWhrx/tPCmCdPQsZrJ2mL1QmgqbUdzVcYn6fuhYxILA== X-Received: by 10.55.22.38 with SMTP id g38mr730372qkh.98.1507334005255; Fri, 06 Oct 2017 16:53:25 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org> To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@gmail.com>, Markus Armbruster <armbru@redhat.com>, Eric Blake <eblake@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com> Date: Fri, 6 Oct 2017 20:49:45 -0300 Message-Id: <20171006235023.11952-51-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 50/88] ivshmem: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Kevin Wolf <kwolf@redhat.com>, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, qemu trival <qemu-trivial@nongnu.org>, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
use g_new() family of functions
|
expand
|
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index b3ef3ec1e3..9dd432a295 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -429,7 +429,7 @@ static void resize_peers(IVShmemState *s, int nb_peers) assert(nb_peers > old_nb_peers); IVSHMEM_DPRINTF("bumping storage to %d peers\n", nb_peers); - s->peers = g_realloc(s->peers, nb_peers * sizeof(Peer)); + s->peers = g_renew(Peer, s->peers, nb_peers); s->nb_peers = nb_peers; for (i = old_nb_peers; i < nb_peers; i++) { @@ -753,7 +753,7 @@ static void ivshmem_reset(DeviceState *d) static int ivshmem_setup_interrupts(IVShmemState *s, Error **errp) { /* allocate QEMU callback data for receiving interrupts */ - s->msi_vectors = g_malloc0(s->vectors * sizeof(MSIVector)); + s->msi_vectors = g_new0(MSIVector, s->vectors); if (ivshmem_has_feature(s, IVSHMEM_MSI)) { if (msix_init_exclusive_bar(PCI_DEVICE(s), s->vectors, 1, errp)) {