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

View File

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