USB: serial: io_ti: fix div-by-zero in set_termios
authorJohan Hovold <johan@kernel.org>
Thu, 11 May 2017 09:41:21 +0000 (11:41 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 15 Sep 2017 17:30:41 +0000 (18:30 +0100)
commit5b044cee0ef9b5f61bca80be15a019eb4ffa6a09
tree7cf9be5720671cb50c878c12acc777c403c02e94
parent18b1af6c5c26c204edb75b9dad5aab2208a7a6a6
USB: serial: io_ti: fix div-by-zero in set_termios

commit 6aeb75e6adfaed16e58780309613a578fe1ee90b upstream.

Fix a division-by-zero in set_termios when debugging is enabled and a
high-enough speed has been requested so that the divisor value becomes
zero.

Instead of just fixing the offending debug statement, cap the baud rate
at the base as a zero divisor value also appears to crash the firmware.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/io_ti.c