mm/circbuf: add sanity check for resize
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
153254a496
commit
9fb130cdea
@ -109,6 +109,10 @@ int circbuf_resize(FAR struct circbuf_s *circ, size_t bytes)
|
||||
|
||||
DEBUGASSERT(circ);
|
||||
DEBUGASSERT(!circ->external);
|
||||
if (bytes == circ->size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bytes)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user