summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-01-10 09:45:12 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-01-11 08:13:57 +0100
commit4fa0771138d0b56fe59ab8ab3b1ce9e594484362 (patch)
treec16c5cd1d10d2bc7bec65b4fc553f206e52a0bc4 /drivers/input
parentInput: serio_raw - really signal HUP upon disconnect (diff)
downloadlinux-4fa0771138d0b56fe59ab8ab3b1ce9e594484362.tar.xz
linux-4fa0771138d0b56fe59ab8ab3b1ce9e594484362.zip
Input: serio_raw - return proper result when serio_raw_write fails
If serio_raw_write was always returning number of bytes successfully sent to serio port and never signalled error condition to the caller. Change it so that for completely failed transfers appropriate error code returned to the caller (partially successful writes still return number of bytes transferred). Reported-by: Che-liang Chiou <clchiou@chromium.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/serio/serio_raw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
index f6c83e9ecff6..8250299fd64f 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -224,7 +224,7 @@ static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
out:
mutex_unlock(&serio_raw_mutex);
- return written;
+ return written ?: retval;
}
static unsigned int serio_raw_poll(struct file *file, poll_table *wait)