From patchwork Thu Nov 8 12:16:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 150509 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp760446ljp; Thu, 8 Nov 2018 04:29:40 -0800 (PST) X-Google-Smtp-Source: AJdET5fT8uqXn6acmO/mmqPU325r73O/25QVtHPDbR2v2utVAmM+Y+NmNXYUiYMGSxjmfdC6orFO X-Received: by 2002:a0c:e8cc:: with SMTP id m12mr4303561qvo.186.1541680180207; Thu, 08 Nov 2018 04:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541680180; cv=none; d=google.com; s=arc-20160816; b=LA1Ry4q7wbBjOfsBF5LkqVSSyrNbkquUYf93IA7+YupbI1ddDazFKYBGft7B52mw7M 06r3uYaAJs/DaX+QrMxy5bcOTNtHkCZNlMcLoyBfHqANQ1pvS3XxhubIsZbkZVWUTUON RuaoqOVksGrPaeGEQ0qAD6PwJLinU+cSz+7zUJfANvqIaEAWQGy1MulvTlpoeRT6pN12 RWp1rJIYPGqse5x4molGQLC/jduvD0/TmHpzqkbi8wrulBMOGe2tl9EbsmKSiflKck18 RCAbNEmCNwhttA4XUD/rR66UiydV2Nk9BT/5UE5Sk+xlj6RUmcAQXJcWGi6U9MPLZcCq K3Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=b9BCjfF1NB2TmxGUmSgwmRFu+e0QdfNbJ5HIZ107Yx4=; b=jlRm/quaLqo2PxMYhMbDfJQEM6Bz9pDtU33JEwDZCe+Qcx5p1jf/OVirco1LjBc+yN THtKLYPI0xt8sfADWo/gEk6vR1dXWz+xqC64ODS14fwkN31LShUN7UFcw5+B3shhDhdf kAYBRtSAHZNts+T3cmiavJd7YOksKIZR821GoVrKQxrXce/olSrrjwyO/fS0SCIaoL/y V2a0tZ1uLY/z7GRMTJ6HIdGoPlcQR+LPMvtDhFB9NmBcdjSl/4CP/JgvIDRBDkQMNb2B vyTITehiPByvN7xBvVewPcDfPlcIdayXO4u75dTrGCtHXhFOd3tsPr8x8Ow3inMA5AtW 5h0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b="nnjKs8/H"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n40si225542qtf.91.2018.11.08.04.29.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 08 Nov 2018 04:29:40 -0800 (PST) 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; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b="nnjKs8/H"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:56319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKjRL-00064f-L1 for patch@linaro.org; Thu, 08 Nov 2018 07:29:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKjFM-0005Hi-He for qemu-devel@nongnu.org; Thu, 08 Nov 2018 07:17:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKjFL-0003vh-3z for qemu-devel@nongnu.org; Thu, 08 Nov 2018 07:17:16 -0500 Received: from ozlabs.org ([203.11.71.1]:44299) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gKjFI-0003jy-In; Thu, 08 Nov 2018 07:17:14 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 42rMj15YNbz9sNL; Thu, 8 Nov 2018 23:16:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1541679413; bh=lnFAh0c0+KxjTYne7Fdk96xTmu8GH4KpqWR5cTEoS/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nnjKs8/HFi6+7pL8yJll09PZaibXcFRz+HQ7OqYbI4bWpc+iswl2R1T+EcqSz0Mfr QeHk/N0CmNIafbeDEvj0DcjUc1O7FUD6xTBRb1Eny6Mp1wmkrpTw+5oyONfP86cPjV m/YJz/qpEpINxR/g/TwVRBvK4X7nubSyLiIC+DS8= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 8 Nov 2018 23:16:39 +1100 Message-Id: <20181108121646.26173-16-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108121646.26173-1-david@gibson.dropbear.id.au> References: <20181108121646.26173-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 15/22] hw/ppc/mac_newworld: Free openpic_irqs array after use 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: lvivier@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In ppc_core99_init(), we allocate an openpic_irqs array, which we then use to collect up the various qemu_irqs which we're going to connect to the interrupt controller. Once we've called sysbus_connect_irq() to connect them all up, the array is no longer required, but we forgot to free it. Since board init is only run once at startup, the memory leak is not a significant one. Spotted by Coverity: CID 1192916. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/ppc/mac_newworld.c | 1 + 1 file changed, 1 insertion(+) -- 2.19.1 diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index a630cb81cd..14273a123e 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -303,6 +303,7 @@ static void ppc_core99_init(MachineState *machine) sysbus_connect_irq(s, k++, openpic_irqs[i][j]); } } + g_free(openpic_irqs); if (PPC_INPUT(env) == PPC_FLAGS_INPUT_970) { /* 970 gets a U3 bus */