Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 2015 16:06:08 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279854 - head/sys/dev/usb/input
Message-ID:  <201503101606.t2AG68iO099263@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503101606.t2AG68iO099263>