summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-21 14:30:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-21 14:30:36 +0000
commite85b5ab98e76e56111e768c8f74bc60f5bcc5987 (patch)
treed317a7da3376901ede0997e702e94c0caad9eed1
parent4d34eccb7fe5f40a721b6c21714e044939a5836a (diff)
in the detach function remove our usb task before calling any other
teardown functions which could potentially sleep (and then, the usb task would get called for a half-torn down device)
-rw-r--r--sys/dev/usb/umbg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/umbg.c b/sys/dev/usb/umbg.c
index 7a774c44352..d88ca94a1e1 100644
--- a/sys/dev/usb/umbg.c
+++ b/sys/dev/usb/umbg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umbg.c,v 1.10 2009/10/13 19:33:19 pirofti Exp $ */
+/* $OpenBSD: umbg.c,v 1.11 2009/11/21 14:30:35 deraadt Exp $ */
/*
* Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org>
@@ -301,6 +301,8 @@ umbg_detach(struct device *self, int flags)
timeout_del(&sc->sc_to);
timeout_del(&sc->sc_it_to);
+ usb_rem_task(sc->sc_udev, &sc->sc_task);
+
if (sc->sc_bulkin_pipe != NULL) {
err = usbd_abort_pipe(sc->sc_bulkin_pipe);
if (err)
@@ -324,8 +326,6 @@ umbg_detach(struct device *self, int flags)
sc->sc_bulkout_pipe = NULL;
}
- usb_rem_task(sc->sc_udev, &sc->sc_task);
-
/* Unregister the clock with the kernel */
sensordev_deinstall(&sc->sc_sensordev);