From nobody Thu Nov 13 19:26:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1582256862; cv=none; d=zohomail.com; s=zohoarc; b=EjQbzPoWltW4Mw5qOFnGmgtHLGlR4xqsdmfZ7/QzOHY4f5yatUb+06lJixiw7hxMSMF8racMVQO6gnLcvz+b9GqJuIZ2YfXtERzFugBcaSCurNUBNvLz+MPjsm+53nvYi4MQcRMVVX0YLlKkh9LPpOr44LVFpW9wEUhPKLO96kY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582256862; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=J5D88OO8lYDRgVzDdr/LEOEOIwRkoAgrzcJWufNKK0I=; b=U4vSDFGS07PyLBCczgaw3wvAy4A/oxi2MZWehHw0w/2YQ/J9rvAVIfqdaeW0pipa9RJdlnNNMtJFGXdNJhCYKsOunRJqRU7xCt9D75e4VAYGYxVF+OpHg5y/LEcK259M/a2GcvjfXPgbpPFtQ0xPOM3r6dMCMDrDd04T5xMBoZw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582256862882900.1205574544628; Thu, 20 Feb 2020 19:47:42 -0800 (PST) Received: from localhost ([::1]:51862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4zHx-0002QT-Tt for importer@patchew.org; Thu, 20 Feb 2020 22:47:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49759) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4z88-0002Vl-Hg for qemu-devel@nongnu.org; Thu, 20 Feb 2020 22:37:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4z86-0000HL-Am for qemu-devel@nongnu.org; Thu, 20 Feb 2020 22:37:32 -0500 Received: from ozlabs.org ([203.11.71.1]:59453) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j4z85-0008Pj-Uk; Thu, 20 Feb 2020 22:37:30 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 48NxwL0xJ0z9sSx; Fri, 21 Feb 2020 14:37:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1582256226; bh=Wp+k5nVHvdO925ifSYOaM86yY3mKvDBuJKP7l44HrBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XkGr2n1geUz2ar+oKYnbMSD3Si3DWimZQgI+vQfmmys0z5d3i0a+E908Oyg+AVtQV hDy4TNkJ1uKelS23bnUL3wK9PbvDuGMyk1EDXSSUf74l1WElcKJiAtn35p5p4kJh1b fQhHs1Wa0gHf7gBeZEEI8LE60gOO01P/Ikxmozp0= From: David Gibson To: peter.maydell@linaro.org Subject: [PULL 20/20] hw/ppc/virtex_ml507:fix leak of fdevice tree blob Date: Fri, 21 Feb 2020 14:36:50 +1100 Message-Id: <20200221033650.444386-21-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200221033650.444386-1-david@gibson.dropbear.id.au> References: <20200221033650.444386-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, Euler Robot , Chen Qun , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Chen Qun The device tree blob returned by load_device_tree is malloced. We should free it after cpu_physical_memory_write(). Reported-by: Euler Robot Signed-off-by: Chen Qun Message-Id: <20200218091154.21696-3-kuhn.chenqun@huawei.com> Signed-off-by: David Gibson --- hw/ppc/virtex_ml507.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index 91dd00ee91..4eef70069f 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -188,6 +188,7 @@ static int xilinx_load_device_tree(hwaddr addr, if (r < 0) fprintf(stderr, "couldn't set /chosen/bootargs\n"); cpu_physical_memory_write(addr, fdt, fdt_size); + g_free(fdt); return fdt_size; } =20 --=20 2.24.1