mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
mempool:need unposion memory when deinit
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -646,6 +646,8 @@ int mempool_deinit(FAR struct mempool_s *pool)
|
|||||||
while ((blk = mempool_remove_queue(pool, &pool->equeue)) != NULL)
|
while ((blk = mempool_remove_queue(pool, &pool->equeue)) != NULL)
|
||||||
{
|
{
|
||||||
blk = (FAR sq_entry_t *)((FAR char *)blk - count * blocksize);
|
blk = (FAR sq_entry_t *)((FAR char *)blk - count * blocksize);
|
||||||
|
|
||||||
|
kasan_unpoison(blk, count * blocksize + sizeof(sq_entry_t));
|
||||||
pool->free(pool, blk);
|
pool->free(pool, blk);
|
||||||
if (pool->expandsize >= blocksize + sizeof(sq_entry_t))
|
if (pool->expandsize >= blocksize + sizeof(sq_entry_t))
|
||||||
{
|
{
|
||||||
@@ -655,6 +657,8 @@ int mempool_deinit(FAR struct mempool_s *pool)
|
|||||||
|
|
||||||
if (pool->ibase)
|
if (pool->ibase)
|
||||||
{
|
{
|
||||||
|
kasan_unpoison(pool->ibase,
|
||||||
|
pool->interruptsize / blocksize * blocksize);
|
||||||
pool->free(pool, pool->ibase);
|
pool->free(pool, pool->ibase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user