mirror of
https://github.com/apache/nuttx.git
synced 2026-03-27 02:29:15 +08:00
mm/circbuf: add sanity check for resize
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user