diff options
| -rw-r--r-- | drivers/usb/serial/io_ti.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index f1a8fdcd8674..e98532feb0cc 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
| @@ -2349,8 +2349,11 @@ static void change_port_settings(struct tty_struct *tty, | |||
| 2349 | if (!baud) { | 2349 | if (!baud) { |
| 2350 | /* pick a default, any default... */ | 2350 | /* pick a default, any default... */ |
| 2351 | baud = 9600; | 2351 | baud = 9600; |
| 2352 | } else | 2352 | } else { |
| 2353 | /* Avoid a zero divisor. */ | ||
| 2354 | baud = min(baud, 461550); | ||
| 2353 | tty_encode_baud_rate(tty, baud, baud); | 2355 | tty_encode_baud_rate(tty, baud, baud); |
| 2356 | } | ||
| 2354 | 2357 | ||
| 2355 | edge_port->baud_rate = baud; | 2358 | edge_port->baud_rate = baud; |
| 2356 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); | 2359 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); |
