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 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, | |||
| 2336 | if (!baud) { | 2336 | if (!baud) { |
| 2337 | /* pick a default, any default... */ | 2337 | /* pick a default, any default... */ |
| 2338 | baud = 9600; | 2338 | baud = 9600; |
| 2339 | } else | 2339 | } else { |
| 2340 | /* Avoid a zero divisor. */ | ||
| 2341 | baud = min(baud, 461550); | ||
| 2340 | tty_encode_baud_rate(tty, baud, baud); | 2342 | tty_encode_baud_rate(tty, baud, baud); |
| 2343 | } | ||
| 2341 | 2344 | ||
| 2342 | edge_port->baud_rate = baud; | 2345 | edge_port->baud_rate = baud; |
| 2343 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); | 2346 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); |
