mempool:need unposion memory when deinit
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
80ea8c3cc7
commit
8f92695ee1
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user