usb: Proper error propagation for usb_device_attach errors

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Hans de Goede 2011-05-27 19:05:15 +02:00 committed by Gerd Hoffmann
parent ee210d6390
commit fa19bf831b
3 changed files with 21 additions and 15 deletions

View file

@ -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: