mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-23 18:12:00 -06:00
Check return value of qdev_init()
But do so only where it may actually fail. Leave the rest for the next commit. Patchworks-ID: 35167 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
18cfeb52d1
commit
33e66b86d8
5 changed files with 12 additions and 6 deletions
|
@ -980,12 +980,14 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
|
|||
|
||||
hostdev_link(dev);
|
||||
|
||||
qdev_init(&d->qdev);
|
||||
if (qdev_init(&d->qdev) < 0)
|
||||
goto fail_no_qdev;
|
||||
return (USBDevice *) dev;
|
||||
|
||||
fail:
|
||||
if (d)
|
||||
qdev_free(&d->qdev);
|
||||
fail_no_qdev:
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
return NULL;
|
||||
|
@ -1389,7 +1391,7 @@ static int usb_host_auto_scan(void *opaque, int bus_num, int addr,
|
|||
|
||||
/* We got a match */
|
||||
|
||||
/* Allredy attached ? */
|
||||
/* Already attached ? */
|
||||
if (hostdev_find(bus_num, addr))
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue