On Wed, Jun 24, 2020 at 06:43:02PM +0200, Markus Armbruster wrote: > macio_newworld_realize() effectively ignores ns->gpio realization > errors, leaking the Error object. Fortunately, macio_gpio_realize() > can't actually fail. Tidy up. > > Cc: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk> > Cc: David Gibson <da...@gibson.dropbear.id.au> > Signed-off-by: Markus Armbruster <arm...@redhat.com>
Acked-by: David Gibson <da...@gibson.dropbear.id.au> > --- > hw/misc/macio/macio.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c > index 7cfe357cc4..bedf10e77b 100644 > --- a/hw/misc/macio/macio.c > +++ b/hw/misc/macio/macio.c > @@ -329,7 +329,9 @@ static void macio_newworld_realize(PCIDevice *d, Error > **errp) > &error_abort); > memory_region_add_subregion(&s->bar, 0x50, > sysbus_mmio_get_region(sysbus_dev, 0)); > - qdev_realize(DEVICE(&ns->gpio), BUS(&s->macio_bus), &err); > + if (!qdev_realize(DEVICE(&ns->gpio), BUS(&s->macio_bus), errp)) { > + return; > + } > > /* PMU */ > object_initialize_child(OBJECT(s), "pmu", &s->pmu, TYPE_VIA_PMU); -- 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