macio: Tidy up error handling in macio_newworld_realize()
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-ayland@ilande.co.uk> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <20200707160613.848843-6-armbru@redhat.com>
This commit is contained in:
parent
118bfd76c9
commit
0a15a73236
@ -334,7 +334,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);
|
||||
|
Loading…
Reference in New Issue
Block a user