Skip to content

Commit 4fa0771

Browse files
committed
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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 0c62fbf commit 4fa0771

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/serio/serio_raw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
224224

225225
out:
226226
mutex_unlock(&serio_raw_mutex);
227-
return written;
227+
return written ?: retval;
228228
}
229229

230230
static unsigned int serio_raw_poll(struct file *file, poll_table *wait)

0 commit comments

Comments
 (0)