From 8f92695ee16fc0b9fd8a6181cc3710fd69105058 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Thu, 6 Jun 2024 14:23:56 +0800 Subject: [PATCH] mempool:need unposion memory when deinit Signed-off-by: anjiahao --- mm/mempool/mempool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/mempool/mempool.c b/mm/mempool/mempool.c index 2a5336cabc..1aa3596359 100644 --- a/mm/mempool/mempool.c +++ b/mm/mempool/mempool.c @@ -646,6 +646,8 @@ int mempool_deinit(FAR struct mempool_s *pool) while ((blk = mempool_remove_queue(pool, &pool->equeue)) != NULL) { blk = (FAR sq_entry_t *)((FAR char *)blk - count * blocksize); + + kasan_unpoison(blk, count * blocksize + sizeof(sq_entry_t)); pool->free(pool, blk); if (pool->expandsize >= blocksize + sizeof(sq_entry_t)) { @@ -655,6 +657,8 @@ int mempool_deinit(FAR struct mempool_s *pool) if (pool->ibase) { + kasan_unpoison(pool->ibase, + pool->interruptsize / blocksize * blocksize); pool->free(pool, pool->ibase); }