summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-03-10 16:06:07 +0000
committerhselasky <hselasky@FreeBSD.org>2015-03-10 16:06:07 +0000
commit3121e258c76aac03e285cba717a62be6d46f1b60 (patch)
tree42377c35108fba6e57c744abaa14654f22bf082b /sys/dev/usb
parentd4fc9fa205a9513477f4a0a4f103c45f13645cc7 (diff)
downloadFreeBSD-src-3121e258c76aac03e285cba717a62be6d46f1b60.zip
FreeBSD-src-3121e258c76aac03e285cba717a62be6d46f1b60.tar.gz
Lock softc before clearing bits.
Found by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/input/uhid.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c
index ece5e95..b0fe3a0 100644
--- a/sys/dev/usb/input/uhid.c
+++ b/sys/dev/usb/input/uhid.c
@@ -518,7 +518,9 @@ uhid_open(struct usb_fifo *fifo, int fflags)
*/
if (fflags & FREAD) {
/* reset flags */
+ mtx_lock(&sc->sc_mtx);
sc->sc_flags &= ~UHID_FLAG_IMMED;
+ mtx_unlock(&sc->sc_mtx);
if (usb_fifo_alloc_buffer(fifo,
sc->sc_isize + 1, UHID_FRAME_NUM)) {
OpenPOWER on IntegriCloud