From 996f8471b103642312b3fb83365f5f9dd617b13e Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Tue, 10 Mar 2015 16:06:07 +0000 Subject: [PATCH] Lock softc before clearing bits. Found by: Dmitry Luhtionov MFC after: 1 week --- sys/dev/usb/input/uhid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c index ece5e9573309..b0fe3a012845 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)) {