🐞 fix(mempool): fix assert (#8364)

This commit is contained in:
xqyjlj 2023-12-24 20:03:28 +08:00 committed by GitHub
parent b8d1d671a9
commit 6be74e227e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@
* 2012-03-22 Bernard fix align issue in rt_mp_init and rt_mp_create.
* 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to mempool.c
* 2023-09-15 xqyjlj perf rt_hw_interrupt_disable/enable
* 2023-12-10 xqyjlj fix spinlock assert
*/
#include <rthw.h>
@ -290,12 +291,13 @@ rt_err_t rt_mp_delete(rt_mp_t mp)
rt_thread_resume(thread);
}
rt_spin_unlock_irqrestore(&(mp->spinlock), level);
/* release allocated room */
rt_free(mp->start_address);
/* detach object */
rt_object_delete(&(mp->parent));
rt_spin_unlock_irqrestore(&(mp->spinlock), level);
return RT_EOK;
}