svn commit: r279854 - head/sys/dev/usb/input

Hans Petter Selasky hselasky at FreeBSD.org
Tue Mar 10 16:06:08 UTC 2015


Author: hselasky
Date: Tue Mar 10 16:06:07 2015
New Revision: 279854
URL: https://svnweb.freebsd.org/changeset/base/279854

Log:
  Lock softc before clearing bits.
  
  Found by:	Dmitry Luhtionov <dmitryluhtionov at gmail.com>
  MFC after:	1 week

Modified:
  head/sys/dev/usb/input/uhid.c

Modified: head/sys/dev/usb/input/uhid.c
==============================================================================
--- head/sys/dev/usb/input/uhid.c	Tue Mar 10 16:01:43 2015	(r279853)
+++ head/sys/dev/usb/input/uhid.c	Tue Mar 10 16:06:07 2015	(r279854)
@@ -518,7 +518,9 @@ uhid_open(struct usb_fifo *fifo, int ffl
 	 */
 	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)) {


More information about the svn-src-all mailing list