diff options
| author | Finder16 <[email protected]> | 2026-11-20 14:41:10 +0900 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-11-23 09:54:18 +0800 |
| commit | 13291f9f1509ed0368eed7328072ddc8c03743b7 (patch) | |
| tree | f0a58ad9f251dddacad6e1d86cb2201af28d74c8 /components/gui/include/rtgui | |
| parent | 89fd2c8ee5822ba9272b525b59d1729804160234 (diff) | |
[drivers][serial] reject reopening a v1 serial device in a different transfer mode
rt_serial_open() allocates serial_rx/serial_tx only on the first open and,
on a reopen, only updated open_flag from the new oflag. Reopening a device
opened with INT_TX in DMA_TX mode therefore kept the 4-byte rt_serial_tx_fifo
while the DMA TX paths used it as struct rt_serial_tx_dma, accessing
data_queue out of bounds (same for INT_RX/DMA_RX with bufsz == 0). A reopen
without a mode flag also cleared the mode bits, so the final close leaked
the buffer.
Return -RT_EBUSY when a reopen requests a mode different from the one the
existing buffer was allocated for, and keep the existing mode bits on
reopen so open_flag always matches the allocated buffer type.
Fixes #12072
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0135ZDSUis4rZz8gmCskkDbm
Diffstat (limited to 'components/gui/include/rtgui')
0 files changed, 0 insertions, 0 deletions
