diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2006-08-24 12:14:24 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2006-08-24 12:14:24 +0000 |
commit | 6b5fcdbde138fe7440e131fd5917883c10a8cf57 (patch) | |
tree | 39e70800432e41ce1ad21c2b18fe0f37af8e50a9 /sys/dev/usb/ucycom.c | |
parent | c117db6b3eef69e42e50e6094e51efbf4931275a (diff) |
when shutting down, wrap the variable manipulation in splusb() so weird
stuff doesn't happen if we're interrupted.
Diffstat (limited to 'sys/dev/usb/ucycom.c')
-rw-r--r-- | sys/dev/usb/ucycom.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index 63653af914f..8da14204f16 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucycom.c,v 1.3 2006/08/18 23:08:45 jason Exp $ */ +/* $OpenBSD: ucycom.c,v 1.4 2006/08/24 12:14:23 jason Exp $ */ /* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */ /* @@ -293,19 +293,21 @@ void ucycom_close(void *addr, int portno) { struct ucycom_softc *sc = addr; + int s; if (sc->sc_dying) return; -// uhidev_close(&sc->sc_hdev); - if (sc->sc_obuf !=NULL) { + s = splusb(); + if (sc->sc_obuf != NULL) { free(sc->sc_obuf, M_USBDEV); sc->sc_obuf = NULL; } - if (sc->sc_ibuf !=NULL) { + if (sc->sc_ibuf != NULL) { free(sc->sc_ibuf, M_USBDEV); sc->sc_ibuf = NULL; } + splx(s); } Static void |