Commit 78aaa47
committed
[drivers][serial/v2] fix missing break after -RT_EPERM when buf size is 0
When rx_bufsz or tx_bufsz is 0, the driver returns -RT_EPERM but falls
through to RT_ASSERT(rx_fifo/tx_fifo != RT_NULL). Since serial_rx/serial_tx
is NULL in non-buffered mode, this triggers an assertion failure.
Add break after setting ret = -RT_EPERM in the four affected cases:
- RT_SERIAL_CTRL_SET_RX_TIMEOUT
- RT_SERIAL_CTRL_SET_TX_TIMEOUT
- RT_SERIAL_CTRL_GET_RX_TIMEOUT
- RT_SERIAL_CTRL_GET_TX_TIMEOUT1 parent 630f4fa commit 78aaa47
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1466 | 1466 | | |
1467 | 1467 | | |
1468 | 1468 | | |
| 1469 | + | |
1469 | 1470 | | |
1470 | 1471 | | |
1471 | 1472 | | |
| |||
1487 | 1488 | | |
1488 | 1489 | | |
1489 | 1490 | | |
| 1491 | + | |
1490 | 1492 | | |
1491 | 1493 | | |
1492 | 1494 | | |
| |||
1507 | 1509 | | |
1508 | 1510 | | |
1509 | 1511 | | |
| 1512 | + | |
1510 | 1513 | | |
1511 | 1514 | | |
1512 | 1515 | | |
| |||
1527 | 1530 | | |
1528 | 1531 | | |
1529 | 1532 | | |
| 1533 | + | |
1530 | 1534 | | |
1531 | 1535 | | |
1532 | 1536 | | |
| |||
0 commit comments