arch/backtrace: correct the skip counter

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2022-06-16 15:29:19 +08:00 committed by Masayuki Ishikawa
parent b33a709213
commit 7790839eb0
1 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ static int backtrace(uintptr_t *base, uintptr_t *limit,
if (pc)
{
i++;
if (*skip-- <= 0)
if ((*skip)-- <= 0)
{
*buffer++ = pc;
}
@ -68,7 +68,7 @@ static int backtrace(uintptr_t *base, uintptr_t *limit,
break;
}
if (*skip-- <= 0)
if ((*skip)-- <= 0)
{
*buffer++ = (void *)*fp;
}