Revision 33e66b86

b/hw/pci-hotplug.c
172 172
    default:
173 173
        dev = NULL;
174 174
    }
175
    if (dev)
176
        qdev_init(&dev->qdev);
175
    if (!dev || qdev_init(&dev->qdev) < 0)
176
        return NULL;
177 177
    return dev;
178 178
}
179 179

  
b/hw/pci.c
833 833
};
834 834

  
835 835
/* Initialize a PCI NIC.  */
836
/* FIXME callers should check for failure, but don't */
836 837
PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model,
837 838
                        const char *default_devaddr)
838 839
{
b/hw/scsi-bus.c
82 82
}
83 83

  
84 84
/* handle legacy '-drive if=scsi,...' cmd line args */
85
/* FIXME callers should check for failure, but don't */
85 86
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit)
86 87
{
87 88
    const char *driver;
......
91 92
    dev = qdev_create(&bus->qbus, driver);
92 93
    qdev_prop_set_uint32(dev, "scsi-id", unit);
93 94
    qdev_prop_set_drive(dev, "drive", dinfo);
94
    qdev_init(dev);
95
    if (qdev_init(dev) < 0)
96
        return NULL;
95 97
    return DO_UPCAST(SCSIDevice, qdev, dev);
96 98
}
97 99

  
b/hw/usb-msd.c
571 571
    /* create guest device */
572 572
    dev = usb_create(NULL /* FIXME */, "QEMU USB MSD");
573 573
    qdev_prop_set_drive(&dev->qdev, "drive", dinfo);
574
    qdev_init(&dev->qdev);
574
    if (qdev_init(&dev->qdev) < 0)
575
        return NULL;
575 576

  
576 577
    return dev;
577 578
}
b/usb-linux.c
980 980

  
981 981
    hostdev_link(dev);
982 982

  
983
    qdev_init(&d->qdev);
983
    if (qdev_init(&d->qdev) < 0)
984
        goto fail_no_qdev;
984 985
    return (USBDevice *) dev;
985 986

  
986 987
fail:
987 988
    if (d)
988 989
        qdev_free(&d->qdev);
990
fail_no_qdev:
989 991
    if (fd != -1)
990 992
        close(fd);
991 993
    return NULL;
......
1389 1391

  
1390 1392
        /* We got a match */
1391 1393

  
1392
        /* Allredy attached ? */
1394
        /* Already attached ? */
1393 1395
        if (hostdev_find(bus_num, addr))
1394 1396
            return 0;
1395 1397

  

Also available in: Unified diff