diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2000-01-26 10:27:12 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2000-01-26 10:27:12 +0000 |
commit | 64cda4e365ddb1be065912f0591b572d1af8aa08 (patch) | |
tree | 5675e9e42d1d17bdf10da353182b8da278d9948b /sys/dev/usb/uhci_pci.c | |
parent | eb4463295ba6da7a5b6c1d94f38f7d52ef926c06 (diff) | |
download | FreeBSD-src-64cda4e365ddb1be065912f0591b572d1af8aa08.zip FreeBSD-src-64cda4e365ddb1be065912f0591b572d1af8aa08.tar.gz |
Don't set ivars until we checked the return value from device_add_child.
Diffstat (limited to 'sys/dev/usb/uhci_pci.c')
-rw-r--r-- | sys/dev/usb/uhci_pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c index 779eb56..d342c81 100644 --- a/sys/dev/usb/uhci_pci.c +++ b/sys/dev/usb/uhci_pci.c @@ -182,12 +182,12 @@ uhci_pci_attach(device_t self) } sc->sc_bus.bdev = device_add_child(self, "usb", -1); - device_set_ivars(sc->sc_bus.bdev, sc); if (!sc->sc_bus.bdev) { device_printf(self, "could not add USB device\n"); err = ENOMEM; goto bad2; } + device_set_ivars(sc->sc_bus.bdev, sc); switch (pci_get_devid(self)) { case PCI_UHCI_DEVICEID_PIIX3: |