diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-05-27 19:05:15 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-06-23 11:28:06 +0200 |
commit | fa19bf831b8c87006533645ece58bc620aca00bc (patch) | |
tree | 7ecadccde072893726196e65ae9069925b01d962 /usb-linux.c | |
parent | ee210d6390761bb0fd6febe0fb8f94ee0dcba0db (diff) | |
download | qemu-fa19bf831b8c87006533645ece58bc620aca00bc.tar.gz qemu-fa19bf831b8c87006533645ece58bc620aca00bc.tar.bz2 qemu-fa19bf831b8c87006533645ece58bc620aca00bc.zip |
usb: Proper error propagation for usb_device_attach errors
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'usb-linux.c')
-rw-r--r-- | usb-linux.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usb-linux.c b/usb-linux.c index 42baafe0a1..9b6f2be0f4 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -1178,10 +1178,14 @@ static int usb_host_open(USBHostDevice *dev, int bus_num, prod_name); } + ret = usb_device_attach(&dev->dev); + if (ret) { + goto fail; + } + /* USB devio uses 'write' flag to check for async completions */ qemu_set_fd_handler(dev->fd, NULL, async_complete, dev); - usb_device_attach(&dev->dev); return 0; fail: |