]> www.infradead.org Git - users/jedix/linux-maple.git/commit
serial: 8250_pci: fix divide error bug if baud rate is 0
authorDavid Müller <d.mueller@elsoft.ch>
Wed, 27 Apr 2016 09:58:32 +0000 (11:58 +0200)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:21:53 +0000 (17:21 -0500)
commit402661daa9557841addb936fdb9a71b0d45a241c
tree7c660dc533884cd1da81ea225c364938cba8e3ba
parenta418c21f12cb5a4806f46f7deb7e7c437caaafeb
serial: 8250_pci: fix divide error bug if baud rate is 0

Orabug: 25256918

[ Upstream commit 6f210c18c1c0f016772c8cd51ae12a02bfb9e7ef ]

Since commit 21947ba654a6 ("serial: 8250_pci: replace switch-case by
formula"), the 8250 driver crashes in the byt_set_termios() function
with a divide error. This is caused by the fact that a baud rate of 0 (B0)
is not handled properly. Fix it by falling back to B9600 in this case.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
Fixes: 21947ba654a6 ("serial: 8250_pci: replace switch-case by formula")
Cc: stable@vger.kernel.org
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit c91d8c2d38843168a5b58bdc6b809495f5f31863)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/tty/serial/8250/8250_pci.c