diff options
author | marcel <marcel@FreeBSD.org> | 2006-04-04 01:16:16 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-04-04 01:16:16 +0000 |
commit | b36d718171c34ee1d855d5e0ea9fd3861ed7fa91 (patch) | |
tree | e88544ea5e00c2a992908d2928e1599286ef76df /sys/dev/uart | |
parent | dde58fbc0d5b9f049e2348a5b203b5f6763d096c (diff) | |
download | FreeBSD-src-b36d718171c34ee1d855d5e0ea9fd3861ed7fa91.zip FreeBSD-src-b36d718171c34ee1d855d5e0ea9fd3861ed7fa91.tar.gz |
In z8530_divisor() return 0 if the calculated divisor is less than 0.
This happens when the baudrate is too high for the given RCLK.
Diffstat (limited to 'sys/dev/uart')
-rw-r--r-- | sys/dev/uart/uart_dev_z8530.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/uart/uart_dev_z8530.c b/sys/dev/uart/uart_dev_z8530.c index 4bde071..c34b0a4 100644 --- a/sys/dev/uart/uart_dev_z8530.c +++ b/sys/dev/uart/uart_dev_z8530.c @@ -71,7 +71,7 @@ z8530_divisor(int rclk, int baudrate) return (0); divisor = (rclk + baudrate) / (baudrate << 1) - 2; - if (divisor >= 65536) + if (divisor < 0 || divisor >= 65536) return (0); act_baud = rclk / 2 / (divisor + 2); |