Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Nov 2017 22:19:19 +0000 (UTC)
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325296 - head/sys/dev/evdev
Message-ID:  <201711012219.vA1MJJeo048939@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wulf
Date: Wed Nov  1 22:19:19 2017
New Revision: 325296
URL: https://svnweb.freebsd.org/changeset/base/325296

Log:
  evdev: Take driver's lock in cdev write handler if necessary
  
  Reviewed by:		gonzo
  Approved by:		gonzo (mentor)
  MFC after:		2 weeks
  Differential Revision:	https://reviews.freebsd.org/D12676

Modified:
  head/sys/dev/evdev/evdev.c

Modified: head/sys/dev/evdev/evdev.c
==============================================================================
--- head/sys/dev/evdev/evdev.c	Wed Nov  1 22:15:19 2017	(r325295)
+++ head/sys/dev/evdev/evdev.c	Wed Nov  1 22:19:19 2017	(r325296)
@@ -813,7 +813,11 @@ evdev_inject_event(struct evdev_dev *evdev, uint16_t t
 	case EV_ABS:
 	case EV_SW:
 push:
+		if (evdev->ev_lock_type != EV_LOCK_INTERNAL)
+			EVDEV_LOCK(evdev);
 		ret = evdev_push_event(evdev, type,  code, value);
+		if (evdev->ev_lock_type != EV_LOCK_INTERNAL)
+			EVDEV_UNLOCK(evdev);
 		break;
 
 	default:



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