summaryrefslogtreecommitdiff
path: root/components/drivers/src/ringbuffer.c
diff options
context:
space:
mode:
authorxph <[email protected]>2020-04-09 16:35:28 +0800
committerGitHub <[email protected]>2020-04-09 16:35:28 +0800
commitca7f01d79b3e0a997c771cec298e4ebd65b75809 (patch)
tree3d2c48aae7203b14038ba7b98b500b5343ed7f2a /components/drivers/src/ringbuffer.c
parentf763f8e7284b0492c5a65ad0abf94ee1963d7dcc (diff)
parentbaa3145bfe61b3330b6a160523cc5470fa5db3a7 (diff)
Merge pull request #1 from RT-Thread/master
sync rtt
Diffstat (limited to 'components/drivers/src/ringbuffer.c')
-rw-r--r--components/drivers/src/ringbuffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/drivers/src/ringbuffer.c b/components/drivers/src/ringbuffer.c
index 2e078ae053..c6a491a7cc 100644
--- a/components/drivers/src/ringbuffer.c
+++ b/components/drivers/src/ringbuffer.c
@@ -332,14 +332,15 @@ struct rt_ringbuffer* rt_ringbuffer_create(rt_uint16_t size)
size = RT_ALIGN_DOWN(size, RT_ALIGN_SIZE);
- rb = rt_malloc(sizeof(struct rt_ringbuffer));
+ rb = (struct rt_ringbuffer *)rt_malloc(sizeof(struct rt_ringbuffer));
if (rb == RT_NULL)
goto exit;
- pool = rt_malloc(size);
+ pool = (rt_uint8_t *)rt_malloc(size);
if (pool == RT_NULL)
{
rt_free(rb);
+ rb = RT_NULL;
goto exit;
}
rt_ringbuffer_init(rb, pool, size);