summaryrefslogtreecommitdiffstats
path: root/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz2017-08-07 19:24:39 +0200
committerDavid Gibson2017-08-09 03:46:44 +0200
commit325837ca3851d7e6761649a44ea3c111e2e1757f (patch)
treea297d9c5b81df70260c68967ac7c812554e1c9b2 /hw/ppc
parenttarget/ppc: Add stub implementation of the PSSCR (diff)
downloadqemu-325837ca3851d7e6761649a44ea3c111e2e1757f.tar.gz
qemu-325837ca3851d7e6761649a44ea3c111e2e1757f.tar.xz
qemu-325837ca3851d7e6761649a44ea3c111e2e1757f.zip
spapr_drc: abort if object_property_add_child() fails
object_property_add_child() can only fail in two cases: - the child already has a parent, which shouldn't happen since the DRC was allocated a few lines above - the parent already has a child with the same name, which would mean the caller tries to create a DRC that already exists In both case, this is a QEMU bug and we should abort. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_drc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 47d94e782a..5260b5d363 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -541,7 +541,7 @@ sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type,
drc->owner = owner;
prop_name = g_strdup_printf("dr-connector[%"PRIu32"]",
spapr_drc_index(drc));
- object_property_add_child(owner, prop_name, OBJECT(drc), NULL);
+ object_property_add_child(owner, prop_name, OBJECT(drc), &error_abort);
object_property_set_bool(OBJECT(drc), true, "realized", NULL);
g_free(prop_name);