[rtems commit] z85c30.c: Do not process 0 baud and return an error ( CID 1399713)
Joel Sherrill
joel at rtems.org
Thu Mar 14 19:26:12 UTC 2019
Module: rtems
Branch: master
Commit: 90232bcf45ed4d778f3f1c208f09076338cd241f
Changeset: http://git.rtems.org/rtems/commit/?id=90232bcf45ed4d778f3f1c208f09076338cd241f
Author: Joel Sherrill <joel at rtems.org>
Date: Tue Mar 12 14:33:20 2019 -0500
z85c30.c: Do not process 0 baud and return an error (CID 1399713)
---
bsps/shared/dev/serial/z85c30.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/bsps/shared/dev/serial/z85c30.c b/bsps/shared/dev/serial/z85c30.c
index 55df9d3..d1f4a6f 100644
--- a/bsps/shared/dev/serial/z85c30.c
+++ b/bsps/shared/dev/serial/z85c30.c
@@ -456,6 +456,15 @@ Z85C30_STATIC int z85c30_set_attributes(
baud_number = (uint32_t) rtems_termios_baud_to_number( baud_requested );
_Assert( baud_number != 0 );
+ /*
+ * POSIX says baud rate of zero is a request to hang up or disconnect.
+ * This is not supported by this driver.
+ */
+ _Assert( baud_number != 0 );
+ if (baud_number == 0) {
+ return -1;
+ }
+
ulBaudDivisor = Z85C30_Baud(
(uint32_t) Console_Port_Tbl[minor]->ulClock,
baud_number
More information about the vc
mailing list