summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2000-01-23 15:42:08 +0000
committern_hibma <n_hibma@FreeBSD.org>2000-01-23 15:42:08 +0000
commit46612cf2e78004965c4ca843a01b43376b764f3f (patch)
treeec278b18cd746a0f3a18d6b25bd762148561c82c /sys
parent6542b31f776796400859598f0a22db81ffef1d18 (diff)
downloadFreeBSD-src-46612cf2e78004965c4ca843a01b43376b764f3f.zip
FreeBSD-src-46612cf2e78004965c4ca843a01b43376b764f3f.tar.gz
Zap the vnodes for the control endpoint as well.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/ugen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 76606a9..f31b83b 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 ) {
OpenPOWER on IntegriCloud