]> git.proxmox.com Git - mirror_ubuntu-zesty-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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:46:32 +0000 (10:46 +0200)
commit88810bcd15c376eeac6d393d69dae10463c3c69a
treec389d15e1abc9bd82e66e5f5af5e4f9da0337118
parent22e6ebd101fb1b410d4f1243c3d271bed003891c
USB: serial: quatech2: fix control-message error handling

BugLink: http://bugs.launchpad.net/bugs/1691369
commit 8c34cb8ddfe808d557b51da983ff10c02793beb2 upstream.

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: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
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>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/usb/serial/quatech2.c