Avi Weiss created an issue: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5555



## Summary
<!--
-->
`tms570_sci_set_attributes` has no protection against `0` baud rate  

`rtems_termios_baud_to_number` documentation shows it can `return 0`  

Can result in divide by zero inside `tms570_sci_set_attributes` in at least one 
or two locations (and then also `tms570_sci_interrupt_last_close`).  

## Steps to reproduce
Code review.  
Snippets from `tms570_sci_set_attributes` where we can end up with 
divide-by-zero:
```c
...
    tw = tw * 5 / baudrate + 1;
...
  bauddiv = (TMS570_VCLK_HZ + baudrate / 2) / baudrate;
...
```

## Expected behaviour

<!--
-->
Need at a minimum simple check to reject `0` and fail early to not flow it 
through to the calculation steps.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5555
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to