From: David Gibson <david@gibson.dropbear.id.au>
To: kuhn.chenqun@huawei.com
Cc: marex@denx.de, zhang.zhanghailiang@huawei.com,
qemu-trivial@nongnu.org, crwulff@gmail.com,
pannengyuan@huawei.com, qemu-devel@nongnu.org,
jcmvbkbc@gmail.com, qemu-ppc@nongnu.org, pbonzini@redhat.com,
edgar.iglesias@gmail.com
Subject: Re: [PATCH 2/3] hw/ppc/virtex_ml507:fix leak of fdevice tree blob
Date: Wed, 19 Feb 2020 10:03:36 +1100 [thread overview]
Message-ID: <20200218230336.GB1764@umbus.fritz.box> (raw)
In-Reply-To: <20200218091154.21696-3-kuhn.chenqun@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]
On Tue, Feb 18, 2020 at 05:11:53PM +0800, kuhn.chenqun@huawei.com wrote:
> From: Chen Qun <kuhn.chenqun@huawei.com>
>
> The device tree blob returned by load_device_tree is malloced.
> We should free it after cpu_physical_memory_write().
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
I've applied this patch to my ppc-for-5.0 staging tree.
> ---
> 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;
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-02-18 23:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 9:11 [PATCH 0/3]hw: Fixs memleak of fdevice tree blob kuhn.chenqun
2020-02-18 9:11 ` [PATCH 1/3] hw/nios2:fix leak " kuhn.chenqun
2020-02-19 9:33 ` Laurent Vivier
2020-02-18 9:11 ` [PATCH 2/3] hw/ppc/virtex_ml507:fix " kuhn.chenqun
2020-02-18 23:03 ` David Gibson [this message]
2020-02-18 9:11 ` [PATCH 3/3] hw/xtensa/xtfpga:fix " kuhn.chenqun
2020-02-18 16:35 ` Max Filippov
2020-02-19 9:30 ` Laurent Vivier
2020-02-18 9:46 ` [PATCH 0/3]hw: Fixs memleak " Chenqun (kuhn)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200218230336.GB1764@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=crwulff@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=jcmvbkbc@gmail.com \
--cc=kuhn.chenqun@huawei.com \
--cc=marex@denx.de \
--cc=pannengyuan@huawei.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).