未验证 提交 dc0aa39b 编写于 作者: B Bluebear233 提交者: GitHub

[DeviceDriver][serial] 修复get_index越界问题

上级 18bf0980
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册