diff options
| author | 2010-08-31 16:38:42 +0000 | |
|---|---|---|
| committer | 2010-08-31 16:38:42 +0000 | |
| commit | 26dcf4f76c33462b59103acd0432e0e69a3b1037 (patch) | |
| tree | ca2650b00a71ecc4fed1d6e27995aecdda1a29db /sys/dev/usb/uhidev.c | |
| parent | in the activate function, order the DVACT_ functions in the order they (diff) | |
| download | wireguard-openbsd-26dcf4f76c33462b59103acd0432e0e69a3b1037.tar.xz wireguard-openbsd-26dcf4f76c33462b59103acd0432e0e69a3b1037.zip | |
In xxactivate() DVACT_DEACTIVATE, when calling a series of config_deactivate()
for sub-devices, return the last error return value instead of |'ing the
failures together and creating some value that is non-0 (bravo!) but
potentially loses the specific error value...
Diffstat (limited to 'sys/dev/usb/uhidev.c')
| -rw-r--r-- | sys/dev/usb/uhidev.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index c15084b7cf6..ec3fcfdc17b 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.38 2010/08/02 23:17:34 miod Exp $ */ +/* $OpenBSD: uhidev.c,v 1.39 2010/08/31 16:38:42 deraadt Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -336,17 +336,19 @@ int uhidev_activate(struct device *self, int act) { struct uhidev_softc *sc = (struct uhidev_softc *)self; - int i, rv = 0; + int i, rv = 0, r; switch (act) { case DVACT_ACTIVATE: break; - case DVACT_DEACTIVATE: for (i = 0; i < sc->sc_nrepid; i++) - if (sc->sc_subdevs[i] != NULL) - rv |= config_deactivate( - &sc->sc_subdevs[i]->sc_dev); + if (sc->sc_subdevs[i] != NULL) { + r = config_deactivate( + &sc->sc_subdevs[i]->sc_dev); + if (r) + rv = r; + } sc->sc_dying = 1; break; } |
