]> git.baikalelectronics.ru Git - kernel.git/commit
Input: don't modify the id of ioctl-provided ff effect on upload failure
authorElias Vanderstuyft <elias.vds@gmail.com>
Sat, 29 Mar 2014 19:08:45 +0000 (12:08 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 29 Mar 2014 19:13:09 +0000 (12:13 -0700)
commit088b027d520e511fa315f428627a2d1f4d31594c
tree135856bdb6fef8d7809ffe4e195c70c972a5af6a
parent1832f7c669876a1b2cc6557a3c519ab1c49e7123
Input: don't modify the id of ioctl-provided ff effect on upload failure

If a new (id == -1) ff effect was uploaded from userspace,
ff-core.c::input_ff_upload() will have assigned a positive number to the
new effect id.  Currently, evdev.c::evdev_do_ioctl() will save this new id
to userspace, regardless of whether the upload succeeded or not.

On upload failure, this can be confusing because the dev->ff->effects[]
array will not contain an element at the index of that new effect id.

This patch fixes this by leaving the id unchanged after upload fails.

Note: Unfortunately applications should still expect changed effect id for
quite some time.

This has been discussed on:
http://www.mail-archive.com/linux-input@vger.kernel.org/msg08513.html
("ff-core effect id handling in case of a failed effect upload")

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Elias Vanderstuyft <elias.vds@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/evdev.c