mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 00:27:19 +08:00
[DeviceDriver][serial] 修复get_index越界问题
This commit is contained in:
parent
18bf098087
commit
dc0aa39b42
@ -393,7 +393,7 @@ static void rt_dma_recv_update_get_index(struct rt_serial_device *serial, rt_siz
|
||||
if (rx_fifo->is_full && len != 0) rx_fifo->is_full = RT_FALSE;
|
||||
|
||||
rx_fifo->get_index += len;
|
||||
if (rx_fifo->get_index > serial->config.bufsz)
|
||||
if (rx_fifo->get_index >= serial->config.bufsz)
|
||||
{
|
||||
rx_fifo->get_index %= serial->config.bufsz;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user