Lock softc before clearing bits.

Found by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2015-03-10 16:06:07 +00:00
parent 276df218b9
commit 996f8471b1

View File

@ -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)) {