]> git.karo-electronics.de Git - linux-beck.git/commit
USB: serial: spcp8x5: fix modem-status handling
authorJohan Hovold <johan@kernel.org>
Thu, 12 Jan 2017 13:56:21 +0000 (14:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Feb 2017 10:10:51 +0000 (11:10 +0100)
commita1fc6fb5f31edc1b6fb8de092f6ab6fbe967aaa7
tree7889fd518c8bec2e982613a32efb05520d970169
parent26805681a45d071ac8df99933d842c1380b7e279
USB: serial: spcp8x5: fix modem-status handling

commit 5ed8d41023751bdd3546f2fe4118304357efe8d2 upstream.

Make sure to detect short control transfers and return zero on success
when retrieving the modem status.

This fixes the TIOCMGET implementation which since e1ed212d8593 ("USB:
spcp8x5: add proper modem-status support") has returned TIOCM_LE on
successful retrieval, and avoids leaking bits from the stack on short
transfers.

This also fixes the carrier-detect implementation which since the above
mentioned commit unconditionally has returned true.

Fixes: e1ed212d8593 ("USB: spcp8x5: add proper modem-status support")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/spcp8x5.c