mm: Terminate the backtrace array with one NULL pointer

since one entry is enough to identify the end of back trace

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-11-24 19:36:21 +08:00
committed by Xiang Xiao
parent 29404ef54e
commit 154bb93c45
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -111,9 +111,9 @@ static inline void mempool_add_backtrace(FAR struct mempool_s *pool,
if (pool->procfs.backtrace)
{
int result = backtrace(buf->backtrace, CONFIG_MM_BACKTRACE);
while (result < CONFIG_MM_BACKTRACE)
if (result < CONFIG_MM_BACKTRACE)
{
buf->backtrace[result++] = NULL;
buf->backtrace[result] = NULL;
}
}
else