aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-07-07 18:05:33 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-07-10 15:01:06 +0200
commit0a15a73236cb068cfd28f8c6846f66ab007f81bb (patch)
treef39c244427034150ce8e7495a778ee8deb4f3ed5
parent118bfd76c9c604588cb3f97811710576f58e5a76 (diff)
downloadqemu-0a15a73236cb068cfd28f8c6846f66ab007f81bb.zip
qemu-0a15a73236cb068cfd28f8c6846f66ab007f81bb.tar.gz
qemu-0a15a73236cb068cfd28f8c6846f66ab007f81bb.tar.bz2
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>
-rw-r--r--hw/misc/macio/macio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 4241479..be66bb7 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -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);