svn commit: r315176 - head/sys/dev/evdev
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Sun Mar 12 19:26:26 UTC 2017
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 at 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)
More information about the svn-src-all
mailing list