未验证 提交 ff09587d 编写于 作者: D David Lin 提交者: GitHub

[components/drivers] update pipe.c

Fixed stackover flow bug when create pipe->fifo
上级 5b300113
......@@ -330,6 +330,11 @@ rt_err_t rt_pipe_open (rt_device_t device, rt_uint16_t oflag)
if (pipe->fifo == RT_NULL)
{
pipe->fifo = rt_ringbuffer_create(pipe->bufsz);
if (pipe->fifo == RT_NULL)
{
rt_mutex_release(&(pipe->lock));
return -RT_ENOMEM;
}
}
rt_mutex_release(&(pipe->lock));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册