aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_ti.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <[email protected]>2017-05-19 08:10:07 +0000
committerGreg Kroah-Hartman <[email protected]>2017-05-19 08:10:07 +0000
commitb51e0ceed1f93a1eda3cbee328a396a188ec79e3 (patch)
tree351d9e1acaea0c3fc0997fc4c14a4d4bfe5e715c /drivers/usb/serial/io_ti.c
parentusb: musb: tusb6010_omap: Do not reset the other direction's packet size (diff)
parentUSB: serial: qcserial: add more Lenovo EM74xx device IDs (diff)
downloadkernel-b51e0ceed1f93a1eda3cbee328a396a188ec79e3.tar.gz
kernel-b51e0ceed1f93a1eda3cbee328a396a188ec79e3.zip
Merge tag 'usb-serial-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus
Johan writes: USB-serial fixes for v4.12-rc2 Here's a fix for a long-standing issue in the ftdi_sio driver that prevented unprivileged users from updating the low-latency flag, something which became apparent after a recent change that restored the older setting of not using low-latency mode by default. A run of sparse revealed a couple of endianness issues that are now fixed, and addressed is also a user-triggerable division-by-zero in io_ti when debugging is enabled. Finally there are some new device ids, including a simplification of how we deal with a couple of older Olimex JTAG adapters. All have been in linux-next with no reported issues. Signed-off-by: Johan Hovold <[email protected]>
Diffstat (limited to 'drivers/usb/serial/io_ti.c')
-rw-r--r--drivers/usb/serial/io_ti.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 87798e625d6c..6cefb9cb133d 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2336,8 +2336,11 @@ static void change_port_settings(struct tty_struct *tty,
if (!baud) {
/* pick a default, any default... */
baud = 9600;
- } else
+ } else {
+ /* Avoid a zero divisor. */
+ baud = min(baud, 461550);
tty_encode_baud_rate(tty, baud, baud);
+ }
edge_port->baud_rate = baud;
config->wBaudRate = (__u16)((461550L + baud/2) / baud);