]> git.baikalelectronics.ru Git - kernel.git/commit
USB: serial: quatech2: fix control-message error handling
authorJohan Hovold <johan@kernel.org>
Thu, 12 Jan 2017 13:56:20 +0000 (14:56 +0100)
committerJohan Hovold <johan@kernel.org>
Mon, 16 Jan 2017 15:38:56 +0000 (16:38 +0100)
commitbadcd8c5e1a48c3fed832bba20188fe4f29d5a74
tree6e74533df5c17d22996c63e78fb34deb9b42d0b3
parent9e53cc3e4d584f427b4ce044d3b3d01399782b90
USB: serial: quatech2: fix control-message error handling

Make sure to detect short control-message transfers when fetching
modem and line state in open and when retrieving registers.

This specifically makes sure that an errno is returned to user space on
errors in TIOCMGET instead of a zero bitmask.

Also drop the unused getdevice function which also lacked appropriate
error handling.

Fixes: be27483350fa ("USB: serial: add quatech2 usb to serial driver")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/quatech2.c