Index: dev/usb/uhub.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/uhub.c,v retrieving revision 1.62 diff -u -r1.62 uhub.c --- dev/usb/uhub.c 15 Aug 2004 23:39:18 -0000 1.62 +++ dev/usb/uhub.c 8 Sep 2004 14:06:45 -0000 @@ -707,7 +707,9 @@ continue; for (i = 0; dev->subdevs[i]; i++) { if (dev->subdevs[i] == child) { +#ifdef ROAM_SKIP_USB_DEVICE_LEAK dev->subdevs[i] = NULL; +#endif return; } } Index: dev/usb/usb_subr.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usb_subr.c,v retrieving revision 1.69 diff -u -r1.69 usb_subr.c --- dev/usb/usb_subr.c 15 Aug 2004 23:39:18 -0000 1.69 +++ dev/usb/usb_subr.c 8 Sep 2004 14:05:51 -0000 @@ -1016,9 +1016,11 @@ if (dv != NULL) { return (USBD_NORMAL_COMPLETION); } +#ifdef ROAM_SKIP_USB_DEVICE_LEAK tmpdv = dev->subdevs; dev->subdevs = 0; free(tmpdv, M_USB); +#endif /* * The generic attach failed, but leave the device as it is. @@ -1346,7 +1348,7 @@ di->udi_speed = dev->speed; if (dev->subdevs != NULL) { - for (i = 0; dev->subdevs[i] && + for (i = 0; dev->subdevs[i] && device_is_attached(dev->subdevs[i]) && i < USB_MAX_DEVNAMES; i++) { strncpy(di->udi_devnames[i], USBDEVPTRNAME(dev->subdevs[i]), USB_MAX_DEVNAMELEN);