qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 04/46] macio: Tidy up error handling in macio_newworld_realiz


From: Eric Blake
Subject: Re: [PATCH 04/46] macio: Tidy up error handling in macio_newworld_realize()
Date: Wed, 24 Jun 2020 16:52:09 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 6/24/20 11:43 AM, Markus Armbruster wrote:
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>
---
  hw/misc/macio/macio.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)


Reviewed-by: Eric Blake <eblake@redhat.com>

diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 7cfe357cc4..bedf10e77b 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -329,7 +329,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);


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]