Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Mar 2017 19:26:25 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315176 - head/sys/dev/evdev
Message-ID:  <201703121926.v2CJQPXS015187@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Sun Mar 12 19:26:24 2017
New Revision: 315176
URL: https://svnweb.freebsd.org/changeset/base/315176

Log:
  [evdev] Do not ignore result evdev_register in UI_DEV_CREATE handler
  
  Make sure that uinput state field reflects actual state by checking
  evdev_register result for errors
  
  Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
  Differential Revision:	https://reviews.freebsd.org/D9320

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

Modified: head/sys/dev/evdev/uinput.c
==============================================================================
--- head/sys/dev/evdev/uinput.c	Sun Mar 12 18:59:16 2017	(r315175)
+++ head/sys/dev/evdev/uinput.c	Sun Mar 12 19:26:24 2017	(r315176)
@@ -501,9 +501,10 @@ uinput_ioctl_sub(struct uinput_cdev_stat
 
 		evdev_set_methods(state->ucs_evdev, state, &uinput_ev_methods);
 		evdev_set_flag(state->ucs_evdev, EVDEV_FLAG_SOFTREPEAT);
-		evdev_register(state->ucs_evdev);
-		state->ucs_state = UINPUT_RUNNING;
-		return (0);
+		ret = evdev_register(state->ucs_evdev);
+		if (ret == 0)
+			state->ucs_state = UINPUT_RUNNING;
+		return (ret);
 
 	case UI_DEV_DESTROY:
 		if (state->ucs_state != UINPUT_RUNNING)



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