mm/circbuf: add sanity check for resize

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2021-12-14 22:02:16 +08:00 committed by Xiang Xiao
parent 153254a496
commit 9fb130cdea

View File

@ -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)
{