qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH 4/4] hw/ppc/spapr: fix spapr->kvm_type leak


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH 4/4] hw/ppc/spapr: fix spapr->kvm_type leak
Date: Thu, 24 Dec 2015 19:36:04 +1100
User-agent: Mutt/1.5.24 (2015-08-30)

On Wed, Dec 23, 2015 at 03:43:21PM +0800, Li Zhijian wrote:
> Cc: David Gibson <address@hidden>
> Cc: Alexander Graf <address@hidden>
> Cc: address@hidden
> Signed-off-by: Li Zhijian <address@hidden>

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]