From bf79729b6ece10552db90a7bca7f46cc8131f434 Mon Sep 17 00:00:00 2001 From: Nick Hibma Date: Sun, 23 Jan 2000 15:42:08 +0000 Subject: [PATCH] Zap the vnodes for the control endpoint as well. --- sys/dev/usb/ugen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 76606a92cf8d..f31b83bd2743 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -688,8 +688,14 @@ USB_DETACH(ugen) mn = self->dv_unit * USB_MAX_ENDPOINTS; vdevgone(maj, mn, mn + USB_MAX_ENDPOINTS - 1, VCHR); #elif defined(__FreeBSD__) + /* destroy the device for the control endpoint */ dev = makedev(UGEN_CDEV_MAJOR, UGENMINOR(USBDEVUNIT(sc->sc_dev), 0)); + vp = SLIST_FIRST(&dev->si_hlist); + if (vp) + VOP_REVOKE(vp, REVOKEALL); destroy_dev(dev); + + /* destroy all devices for the other (existing) endpoints as well */ for (endptno = 1; endptno < USB_MAX_ENDPOINTS; endptno++) { if (sc->sc_endpoints[endptno][IN].sc != NULL || sc->sc_endpoints[endptno][OUT].sc != NULL ) {