|
@@ -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);
|