lkml.org 
[lkml]   [2016]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.12 026/127] USB: serial: cp210x: fix tiocmget error handling
    Date
    From: Johan Hovold <johan@kernel.org>

    3.12-stable review patch. If anyone has any objections, please let me know.

    ===============

    commit de24e0a108bc48062e1c7acaa97014bce32a919f upstream.

    The current tiocmget implementation would fail to report errors up the
    stack and instead leaked a few bits from the stack as a mask of
    modem-status flags.

    Fixes: 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control")
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    ---
    drivers/usb/serial/cp210x.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
    index f5e4fda7f902..188e50446514 100644
    --- a/drivers/usb/serial/cp210x.c
    +++ b/drivers/usb/serial/cp210x.c
    @@ -919,7 +919,9 @@ static int cp210x_tiocmget(struct tty_struct *tty)
    unsigned int control;
    int result;

    - cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
    + result = cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
    + if (result)
    + return result;

    result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
    |((control & CONTROL_RTS) ? TIOCM_RTS : 0)
    --
    2.10.2
    \
     
     \ /
      Last update: 2016-11-25 09:32    [W:3.232 / U:0.400 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site