RTEMS | Review all uart/console driver set_attributes() for B0 handling (#5558)
SHIVAM DEOLANKAR (@D3athSkulll)
gitlab at rtems.org
Sat Apr 25 01:21:30 UTC 2026
SHIVAM DEOLANKAR commented: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5558#note_149038
I have reviewed the shared bsp folders for the following analysis. ns16550 files need a change for this similar to the attached MR.
**Reviewed `z85c30_set_attributes()` in z85c30.c**\
The driver already guards against zero baud rate using assertions and runtime checks. No division-by-zero risk exists. Behavior differs slightly (defaults to 9600 for B0), but it is safe.
Reviewed `versal_uart_set_attributes()` in **versal-uart.c**
The driver safely handles `baud == 0` by skipping baud configuration. No division or unsafe computation occurs. B0 is explicitly ignored, consistent with lack of modem control support. No changes required.
Reviewed `zynq_uart_set_attributes()` in **zynq-uart.c.**
The driver safely handles baud rate 0 by guarding all computations and hardware updates with `desired_baud > 0`. B0 is explicitly ignored, and no division-by-zero risk exists. No changes required.
Reviewed `ns16550_set_attributes()` in **_ns16550-context.c._**
The function relies on `_Assert(baud_requested != 0)` but lacks a runtime guard. Since assertions may be disabled, this can lead to divide-by-zero in `NS16550_GetBaudDivisor()`. Need to add explicit check to return false when baud is 0 similar to MR !1216.
Reviewed `ns16550_set_attributes()` in **_ns16550.c._**
The function relies solely on `_Assert` to prevent zero baud rate. Since assertions may be disabled, this can lead to divide-by-zero in `NS16550_GetBaudDivisor()`. We can add runtime check to return error when baud is 0.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5558#note_149038
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260425/68a50f9b/attachment-0001.htm>
More information about the bugs
mailing list