From ee3e2401e7727d9ed932492b4c904d41abbb2b7b Mon Sep 17 00:00:00 2001 From: rongbaichuan Date: Sun, 4 May 2025 18:11:46 +0800 Subject: [PATCH] libc/backtrace: Fix compilation error when set LIBC_BACKTRACE_BUFFSIZE When compiling lib_backtrace.c after set CONFIG_LIBC_BACKTRACE_BUFFSIZE, there will be compilation error warnings. This is because spin_unlock_irqrestore incorrectly used pool->lock during unlocking, which has been corrected to bp->lock. Signed-off-by: Baichuan Rong --- libs/libc/misc/lib_backtrace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/libc/misc/lib_backtrace.c b/libs/libc/misc/lib_backtrace.c index 8945e76f11..c84d858b62 100644 --- a/libs/libc/misc/lib_backtrace.c +++ b/libs/libc/misc/lib_backtrace.c @@ -267,14 +267,14 @@ int backtrace_record(int skip) entry = &bp->pool[index]; entry->count++; - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irqrestore(&bp->lock, flags); return index; } index = backtrace_alloc(bp); if (index < 0) { - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irqrestore(&bp->lock, flags); return index; } @@ -289,7 +289,7 @@ int backtrace_record(int skip) entry->next = bp->bucket[slot]; bp->bucket[slot] = index; - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irqrestore(&bp->lock, flags); return index; } @@ -323,7 +323,7 @@ int backtrace_remove(int index) if (entry->count > 1) { entry->count--; - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irqrestore(&bp->lock, flags); return OK; } @@ -367,7 +367,7 @@ int backtrace_remove(int index) } backtrace_free(bp, index); - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irqrestore(&bp->lock, flags); return OK; }