[lkml]   [2012]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 2/2] Input: serio_raw - return error code instead of written on error
    Even if an error occurs and error code is set, serio_raw_write() returns
    the amount of bytes written anyway.

    If this behavior is actually desirable, serio_raw_write() should not
    even bother to set the error code because it is not intended to be
    returned to the caller.

    Signed-off-by: Che-Liang Chiou <>
    drivers/input/serio/serio_raw.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
    index a935c38..32416f7 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,

    - return written;
    + return retval ?: written;

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

     \ /
      Last update: 2012-01-06 12:05    [W:0.019 / U:7.104 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site