mempool:fix a bug when use smp on mempool backtrace

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2022-12-01 00:35:25 +08:00 committed by Alin Jerpelea
parent 01c96a211f
commit 288725a5f8
1 changed files with 1 additions and 3 deletions

View File

@ -317,7 +317,7 @@ out_with_lock:
void mempool_free(FAR struct mempool_s *pool, FAR void *blk)
{
irqstate_t flags;
irqstate_t flags = spin_lock_irqsave(&pool->lock);
#if CONFIG_MM_BACKTRACE >= 0
size_t blocksize = ALIGN_UP(pool->blocksize +
sizeof(struct mempool_backtrace_s),
@ -332,8 +332,6 @@ void mempool_free(FAR struct mempool_s *pool, FAR void *blk)
pool->nalloc--;
#endif
flags = spin_lock_irqsave(&pool->lock);
if (pool->interruptsize > blocksize)
{
if ((FAR char *)blk >= pool->ibase &&