From 14e9ee2b51b1197865e6df33d91c1155b977790e Mon Sep 17 00:00:00 2001 From: n_hibma Date: Mon, 17 Jun 2002 20:52:26 +0000 Subject: Set the ivars _after_ checking that the bdev was correctly created instead of before. --- sys/dev/usb/usb_subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/usb/usb_subr.c') diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index dec2945..2d7f445 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -804,11 +804,11 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev, */ device_t bdev; bdev = device_add_child(parent, NULL, -1); - device_set_ivars(bdev, &uaa); if (!bdev) { printf("%s: Device creation failed\n", USBDEVNAME(dev->bus->bdev)); return (USBD_INVAL); } + device_set_ivars(bdev, &uaa); device_quiet(bdev); #endif @@ -890,12 +890,12 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev, #if defined(__FreeBSD__) /* create another child for the next iface */ bdev = device_add_child(parent, NULL, -1); - device_set_ivars(bdev, &uaa); if (!bdev) { printf("%s: Device creation failed\n", USBDEVNAME(dev->bus->bdev)); return (USBD_NORMAL_COMPLETION); } + device_set_ivars(bdev, &uaa); device_quiet(bdev); #endif } -- cgit v1.1