From: David Gibson <david@gibson.dropbear.id.au>
To: Li Zhijian <lizhijian@cn.fujitsu.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 4/4] hw/ppc/spapr: fix spapr->kvm_type leak
Date: Thu, 24 Dec 2015 19:36:04 +1100 [thread overview]
Message-ID: <20151224083604.GA3011@voom.redhat.com> (raw)
In-Reply-To: <1450856601-4944-5-git-send-email-lizhijian@cn.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]
On Wed, Dec 23, 2015 at 03:43:21PM +0800, Li Zhijian wrote:
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Since the machine has a lifetime basically equal to the runtime of
qemu, it's not a terribly important leak. Still, might as well get it
right.
Merged into my ppc-for-2.6 branch.
> ---
> hw/ppc/spapr.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 6bfb908..65b2d61 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2101,6 +2101,13 @@ static void spapr_machine_initfn(Object *obj)
> NULL);
> }
>
> +static char *spapr_machine_finalizefn(Object *obj)
> +{
> + sPAPRMachineState *spapr = SPAPR_MACHINE(obj);
> +
> + g_free(spapr->kvm_type);
> +}
> +
> static void ppc_cpu_do_nmi_on_cpu(void *arg)
> {
> CPUState *cs = arg;
> @@ -2288,6 +2295,7 @@ static const TypeInfo spapr_machine_info = {
> .abstract = true,
> .instance_size = sizeof(sPAPRMachineState),
> .instance_init = spapr_machine_initfn,
> + .instance_finalize = spapr_machine_finalizefn,
> .class_size = sizeof(sPAPRMachineClass),
> .class_init = spapr_machine_class_init,
> .interfaces = (InterfaceInfo[]) {
--
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: 819 bytes --]
prev parent reply other threads:[~2015-12-24 10:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 7:43 [Qemu-devel] [PATCH 0/4] fix memory leak which allocted by the setter of object_property_add_str Li Zhijian
2015-12-23 7:43 ` [Qemu-devel] [PATCH 1/4] net/filter: fix nf->netdev_id leak Li Zhijian
2015-12-24 3:24 ` Jason Wang
2015-12-23 7:43 ` [Qemu-devel] [PATCH 2/4] net/dump: fix nfds->filename leak Li Zhijian
2015-12-24 3:25 ` Jason Wang
2015-12-23 7:43 ` [Qemu-devel] [PATCH 3/4] backends/hostmem-file: fix fb->mem_path leak Li Zhijian
2015-12-23 13:32 ` Igor Mammedov
2015-12-23 7:43 ` [Qemu-devel] [PATCH 4/4] hw/ppc/spapr: fix spapr->kvm_type leak Li Zhijian
2015-12-24 8:36 ` David Gibson [this message]
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=20151224083604.GA3011@voom.redhat.com \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=lizhijian@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).