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
1 changed files with 5 additions and 5 deletions
|
|
@ -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…
Add table
Reference in a new issue