summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/icom.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-11-13 17:04:56 +0100
committerGeert Uytterhoeven <geert+renesas@glider.be>2015-12-17 11:18:29 +0100
commitde01e6cd0b100bac088b1d59a7040ebe2af64f1c (patch)
treeaeaefb1b24c68ad3f41a7769bcc29e08279e39e4 /drivers/tty/serial/icom.c
parent95a2703e36530c09a9416321ec21c062f3e91d01 (diff)
serial: sh-sci: Avoid overflow in sci_baud_calc_hscif()
If bps >= 1048576, the multiplication of the predivider and "bps" will overflow, and both br and err will contain bogus values. Skip the current and all higher clock select predividers when overflow is detected. Simplify the calculations using intermediates while we're at it. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/icom.c')
0 files changed, 0 insertions, 0 deletions