Signed-off-by: Markus Armbruster <arm...@redhat.com> --- hw/usb/bus.c | 4 ---- hw/usb/dev-bluetooth.c | 6 +----- hw/usb/dev-network.c | 3 --- hw/usb/dev-serial.c | 3 --- hw/usb/dev-storage.c | 3 --- 5 files changed, 1 insertion(+), 18 deletions(-)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 986b2d8..eeb6872 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -320,10 +320,6 @@ USBDevice *usb_create_simple(USBBus *bus, const char *name) USBDevice *dev = usb_create(bus, name); int rc; - if (!dev) { - error_report("Failed to create USB device '%s'", name); - return NULL; - } rc = qdev_init(&dev->qdev); if (rc < 0) { error_report("Failed to initialize USB device '%s'", name); diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index 390d475..8b3b316 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -530,14 +530,10 @@ static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline) } else { hci = bt_new_hci(qemu_find_bt_vlan(0)); } - if (!hci) return NULL; + dev = usb_create(bus, name); - if (!dev) { - error_report("Failed to create USB device '%s'", name); - return NULL; - } s = DO_UPCAST(struct USBBtState, dev, dev); s->hci = hci; if (qdev_init(&dev->qdev) < 0) { diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 5b95d5c..620fc11 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1405,9 +1405,6 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline) } dev = usb_create(bus, "usb-net"); - if (!dev) { - return NULL; - } qdev_set_nic_properties(&dev->qdev, &nd_table[idx]); qdev_init_nofail(&dev->qdev); return dev; diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 1cee450..f347c05 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -544,9 +544,6 @@ static USBDevice *usb_serial_init(USBBus *bus, const char *filename) return NULL; dev = usb_create(bus, "usb-serial"); - if (!dev) { - return NULL; - } qdev_prop_set_chr(&dev->qdev, "chardev", cdrv); if (vendorid) qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid); diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 4539733..5f22275 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -706,9 +706,6 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename) /* create guest device */ dev = usb_create(bus, "usb-storage"); - if (!dev) { - return NULL; - } if (qdev_prop_set_drive(&dev->qdev, "drive", blk_by_legacy_dinfo(dinfo)) < 0) { object_unparent(OBJECT(dev)); -- 1.9.3