qdev: Ignore Error objects where the return value suffices
authorMarkus Armbruster <armbru@redhat.com>
Tue, 7 Jul 2020 16:06:12 +0000 (18:06 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 10 Jul 2020 13:18:09 +0000 (15:18 +0200)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-45-armbru@redhat.com>

hw/core/qdev-properties.c

index 2bec8a80b83a07cb9540ccd5bc238c8dc0110c21..098298c78e6d32056e717de7b392a60c9118440d 100644 (file)
@@ -742,7 +742,6 @@ static void set_pci_devfn(Object *obj, Visitor *v, const char *name,
     Property *prop = opaque;
     int32_t value, *ptr = qdev_get_prop_ptr(dev, prop);
     unsigned int slot, fn, n;
-    Error *local_err = NULL;
     char *str;
 
     if (dev->realized) {
@@ -750,9 +749,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    if (!visit_type_str(v, name, &str, &local_err)) {
-        error_free(local_err);
-        local_err = NULL;
+    if (!visit_type_str(v, name, &str, NULL)) {
         if (!visit_type_int32(v, name, &value, errp)) {
             return;
         }