未验证 提交 add3eede 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #1631 from Bluebear233/patch-4

[DeviceDriver][serial] 修复get_index越界问题
......@@ -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.
先完成此消息的编辑!
想要评论请 注册