]> git.baikalelectronics.ru Git - kernel.git/commit
Input: serio_raw - signal EFAULT even if read/write partially succeeds
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 2 May 2012 07:13:38 +0000 (00:13 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 2 May 2012 07:21:13 +0000 (00:21 -0700)
commit06279f4326daf336cdeaa02fee74fd8ac787e033
tree89b9c43c0ed3e3939977c2f90eeb8c57f86fa99a
parent35eb32ec46bc5fb8e011faa4aaa17a4acdc75268
Input: serio_raw - signal EFAULT even if read/write partially succeeds

When copy_to/from_user fails in the middle of transfer we should not
report to the user that read/write partially succeeded but rather
report -EFAULT right away, so that application will know that it got
its buffers all wrong.

If application messed up its buffers we can't trust the data fetched
from userspace and successfully written to the device or if data read
from the device and transferred to userspace ended up where application
expected it to end.

If serio_write() fails we still going to report partial writes if failure
happens in the middle of the transfer.

This is basically a revert of 98804a8ff7df2873cf2b6ea3234599b5062b6605
and 5e5f57022ba9461654396a44573e2c60d8f15745.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/serio/serio_raw.c