Skip to content

Commit

Permalink
Input: serio_raw - return proper result when serio_raw_write fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov committed Jan 11, 2012
1 parent 0c62fbf commit 4fa0771
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/serio/serio_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4fa0771

Please sign in to comment.