On Mon, Feb 28, 2022 at 02:49:53PM -0300, Daniel Henrique Barboza wrote: > And get rid of the 'out' label since it's now used.
s/used/unused/ > > Signed-off-by: Daniel Henrique Barboza <danielhb...@gmail.com> Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> > --- > hw/ppc/spapr_caps.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c > index 6167431271..aab313ffb1 100644 > --- a/hw/ppc/spapr_caps.c > +++ b/hw/ppc/spapr_caps.c > @@ -120,7 +120,7 @@ static void spapr_cap_set_string(Object *obj, Visitor *v, > const char *name, > SpaprCapabilityInfo *cap = opaque; > SpaprMachineState *spapr = SPAPR_MACHINE(obj); > uint8_t i; > - char *val; > + g_autofree char *val = NULL; > > if (!visit_type_str(v, name, &val, errp)) { > return; > @@ -128,20 +128,18 @@ static void spapr_cap_set_string(Object *obj, Visitor > *v, const char *name, > > if (!strcmp(val, "?")) { > error_setg(errp, "%s", cap->possible->help); > - goto out; > + return; > } > for (i = 0; i < cap->possible->num; i++) { > if (!strcasecmp(val, cap->possible->vals[i])) { > spapr->cmd_line_caps[cap->index] = true; > spapr->eff.caps[cap->index] = i; > - goto out; > + return; > } > } > > error_setg(errp, "Invalid capability mode \"%s\" for cap-%s", val, > cap->name); > -out: > - g_free(val); > } > > static void spapr_cap_get_pagesize(Object *obj, Visitor *v, const char *name, -- 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
signature.asc
Description: PGP signature