]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerJohan Hovold <johan@kernel.org>
Mon, 15 May 2017 09:52:04 +0000 (11:52 +0200)
commit78971b3f9554d5ae3069901236b827f695ff407e
tree4dfbc9180a80ceffbcf043c58f2fd82cd754138b
parent5182d962be0ca96b32693a81da77cfda496c0150
USB: serial: io_ti: fix div-by-zero in set_termios

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")
Cc: stable <stable@vger.kernel.org> # 2.6.12
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/io_ti.c