aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/bus.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-07-07 18:06:04 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-07-10 15:18:08 +0200
commit992861fb1e4cf410f30ec8f05bd2dc2a14a5a027 (patch)
tree9d4d5de47d4ebae50838cd7f8ea39b89a3604507 /hw/usb/bus.c
parentaf175e85f92c870386ad74f466e29537b79611d3 (diff)
downloadqemu-992861fb1e4cf410f30ec8f05bd2dc2a14a5a027.zip
qemu-992861fb1e4cf410f30ec8f05bd2dc2a14a5a027.tar.gz
qemu-992861fb1e4cf410f30ec8f05bd2dc2a14a5a027.tar.bz2
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 <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-37-armbru@redhat.com>
Diffstat (limited to 'hw/usb/bus.c')
-rw-r--r--hw/usb/bus.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index ba27afe..b17bda3 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -723,15 +723,13 @@ static bool usb_get_attached(Object *obj, Error **errp)
static void usb_set_attached(Object *obj, bool value, Error **errp)
{
USBDevice *dev = USB_DEVICE(obj);
- Error *err = NULL;
if (dev->attached == value) {
return;
}
if (value) {
- usb_device_attach(dev, &err);
- error_propagate(errp, err);
+ usb_device_attach(dev, errp);
} else {
usb_device_detach(dev);
}