diff options
Diffstat (limited to 'drivers/tty/tty_baudrate.c')
| -rw-r--r-- | drivers/tty/tty_baudrate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c index 7576ceace571..f438eaa68246 100644 --- a/drivers/tty/tty_baudrate.c +++ b/drivers/tty/tty_baudrate.c | |||
| @@ -77,7 +77,7 @@ speed_t tty_termios_baud_rate(struct ktermios *termios) | |||
| 77 | else | 77 | else |
| 78 | cbaud += 15; | 78 | cbaud += 15; |
| 79 | } | 79 | } |
| 80 | return baud_table[cbaud]; | 80 | return cbaud >= n_baud_table ? 0 : baud_table[cbaud]; |
| 81 | } | 81 | } |
| 82 | EXPORT_SYMBOL(tty_termios_baud_rate); | 82 | EXPORT_SYMBOL(tty_termios_baud_rate); |
| 83 | 83 | ||
| @@ -113,7 +113,7 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios) | |||
| 113 | else | 113 | else |
| 114 | cbaud += 15; | 114 | cbaud += 15; |
| 115 | } | 115 | } |
| 116 | return baud_table[cbaud]; | 116 | return cbaud >= n_baud_table ? 0 : baud_table[cbaud]; |
| 117 | #else /* IBSHIFT */ | 117 | #else /* IBSHIFT */ |
| 118 | return tty_termios_baud_rate(termios); | 118 | return tty_termios_baud_rate(termios); |
| 119 | #endif /* IBSHIFT */ | 119 | #endif /* IBSHIFT */ |
