qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Shivaprasad G Bhat <sbhat@linux.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] ppc: Fix some memory leaks
Date: Wed, 17 Jul 2019 11:39:09 +1000	[thread overview]
Message-ID: <20190717013909.GC2217@umbus.fritz.box> (raw)
In-Reply-To: <58500cfb-cacb-17e9-f993-4107289a5f44@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-07-17  2:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16  8:24 [Qemu-devel] [PATCH] ppc: Fix some memory leaks Shivaprasad G Bhat
2019-07-16  9:16 ` David Gibson
2019-07-16 14:44 ` Richard Henderson
2019-07-17  1:39   ` David Gibson [this message]
2019-07-16 16:28 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz

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=20190717013909.GC2217@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sbhat@linux.ibm.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).