qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] ppc: Fix some memory leaks


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH] ppc: Fix some memory leaks
Date: Wed, 17 Jul 2019 11:39:09 +1000
User-agent: Mutt/1.12.0 (2019-05-25)

On Tue, Jul 16, 2019 at 07:44:24AM -0700, Richard Henderson wrote:
> On 7/16/19 8:24 AM, Shivaprasad G Bhat wrote:
> > @@ -827,6 +827,7 @@ int spapr_dt_drc(void *fdt, int offset, Object *owner, 
> > uint32_t drc_type_mask)
> >          Object *obj;
> >          SpaprDrc *drc;
> >          SpaprDrcClass *drck;
> > +        const char *drc_name = NULL;
> >          uint32_t drc_index, drc_power_domain;
> >  
> >          if (!strstart(prop->type, "link<", NULL)) {
> > @@ -856,8 +857,10 @@ int spapr_dt_drc(void *fdt, int offset, Object *owner, 
> > uint32_t drc_type_mask)
> >          g_array_append_val(drc_power_domains, drc_power_domain);
> >  
> >          /* ibm,drc-names */
> > -        drc_names = g_string_append(drc_names, spapr_drc_name(drc));
> > +        drc_name = spapr_drc_name(drc);
> > +        drc_names = g_string_append(drc_names, drc_name);
> >          drc_names = g_string_insert_len(drc_names, -1, "\0", 1);
> > +        g_free((char *)drc_name);
> 
> This sort of casting means that you got the original type wrong.

Ah, good point.  And spapr_drc_name() has the wrong type also.  I've
pulled this patch out of my ppc-for-4.2 tree until this is fixed up.

-- 
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]