mirror of
https://github.com/apache/nuttx.git
synced 2025-05-08 22:32:04 +08:00
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 <rongbaichuan1027@163.com>
This commit is contained in:
parent
5d2f121231
commit
ee3e2401e7
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user