From: Paolo Bonzini Date: Wed, 11 Jun 2014 12:52:08 +0000 (+0200) Subject: qdev: reorganize error reporting in bus_set_realized X-Git-Tag: v2.7.1~1700^2~14 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b7b34d055d82abaa511b35c9fc24efbb63dca0b1;p=mirror_qemu.git qdev: reorganize error reporting in bus_set_realized No semantic change. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Tested-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Andreas Färber --- diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3226a71d30..65aa041285 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -573,27 +573,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,