On Wed, Jul 17, 2019 at 03:20:01AM -0500, Shivaprasad G Bhat wrote: > Leaking the drc_name while preparing the DT properties. > Fixing that. > > Also, remove the const qualifier from spapr_drc_name(). > > Signed-off-by: Shivaprasad G Bhat Applied to ppc-for-4.2, thanks. > --- > hw/ppc/spapr_drc.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c > index bacadfcac5..695a0b2285 100644 > --- a/hw/ppc/spapr_drc.c > +++ b/hw/ppc/spapr_drc.c > @@ -226,7 +226,7 @@ static uint32_t drc_set_unusable(SpaprDrc *drc) > return RTAS_OUT_SUCCESS; > } > > -static const char *spapr_drc_name(SpaprDrc *drc) > +static char *spapr_drc_name(SpaprDrc *drc) > { > SpaprDrcClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); > > @@ -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; > + 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(drc_name); > > /* ibm,drc-types */ > drc_types = g_string_append(drc_types, drck->typename); > -- 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