summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2fd5100522..f52f0ac3e3 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -520,27 +520,19 @@ static void bus_set_realized(Object *obj, bool value, Error **errp)
if (value && !bus->realized) {
if (bc->realize) {
bc->realize(bus, &local_err);
-
- if (local_err != NULL) {
- goto error;
- }
-
}
} else if (!value && bus->realized) {
if (bc->unrealize) {
bc->unrealize(bus, &local_err);
-
- if (local_err != NULL) {
- goto error;
- }
}
}
- bus->realized = value;
- return;
+ if (local_err != NULL) {
+ error_propagate(errp, local_err);
+ return;
+ }
-error:
- error_propagate(errp, local_err);
+ bus->realized = value;
}
void qbus_create_inplace(void *bus, size_t size, const char *typename,