diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-23 06:27:13 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-23 06:27:13 +0000 |
commit | 8fe25da9d7762dba747313181158c50980ec44e0 (patch) | |
tree | 1549a3c414202ab70b3d2420c536b509f0fa2c81 /sys/dev/usb/uhidev.c | |
parent | 3d772db769af639e71686fe04b7b9bafc9aa27de (diff) |
In a drivers activate() entry point, if on DVACT_DEACTIVATE it does
something, then it MUST return zero on DVACT_ACTIVATE, not EOPNOTSUPP;
this very popular bug has been cut and pasted a lot of times...
ok deraadt@ mickey@
Diffstat (limited to 'sys/dev/usb/uhidev.c')
-rw-r--r-- | sys/dev/usb/uhidev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index d6ff3465b56..81f2c59ec8f 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.15 2006/06/17 16:27:58 miod Exp $ */ +/* $OpenBSD: uhidev.c,v 1.16 2006/06/23 06:27:11 miod Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -336,14 +336,13 @@ int uhidev_activate(device_ptr_t self, enum devact act) { struct uhidev_softc *sc = (struct uhidev_softc *)self; - int i, rv; + int i, rv = 0; switch (act) { case DVACT_ACTIVATE: - return (EOPNOTSUPP); + break; case DVACT_DEACTIVATE: - rv = 0; for (i = 0; i < sc->sc_nrepid; i++) if (sc->sc_subdevs[i] != NULL) rv |= config_deactivate( |