From 992861fb1e4cf410f30ec8f05bd2dc2a14a5a027 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 7 Jul 2020 18:06:04 +0200 Subject: error: Eliminate error_propagate() manually When all we do with an Error we receive into a local variable is propagating to somewhere else, we can just as well receive it there right away. The previous two commits did that for sufficiently simple cases with Coccinelle. Do it for several more manually. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20200707160613.848843-37-armbru@redhat.com> --- hw/intc/xive.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'hw/intc') diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 3459165..9a16243 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -757,7 +757,6 @@ static const TypeInfo xive_tctx_info = { Object *xive_tctx_create(Object *cpu, XivePresenter *xptr, Error **errp) { - Error *local_err = NULL; Object *obj; obj = object_new(TYPE_XIVE_TCTX); @@ -765,16 +764,11 @@ Object *xive_tctx_create(Object *cpu, XivePresenter *xptr, Error **errp) object_unref(obj); object_property_set_link(obj, "cpu", cpu, &error_abort); object_property_set_link(obj, "presenter", OBJECT(xptr), &error_abort); - if (!qdev_realize(DEVICE(obj), NULL, &local_err)) { - goto error; + if (!qdev_realize(DEVICE(obj), NULL, errp)) { + object_unparent(obj); + return NULL; } - return obj; - -error: - object_unparent(obj); - error_propagate(errp, local_err); - return NULL; } void xive_tctx_destroy(XiveTCTX *tctx) -- cgit v1.1