From 8e57b5fdd4636b3b3a39f78cbd3f4cbc6396b207 Mon Sep 17 00:00:00 2001 From: Shell Date: Fri, 13 Oct 2023 14:21:06 +0800 Subject: [PATCH] [smart] fixup: lwp_free() (#8126) Signed-off-by: shell --- components/lwp/lwp_pid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/lwp/lwp_pid.c b/components/lwp/lwp_pid.c index a52265debd..adfa167c72 100644 --- a/components/lwp/lwp_pid.c +++ b/components/lwp/lwp_pid.c @@ -425,6 +425,7 @@ void lwp_free(struct rt_lwp* lwp) #ifdef ARCH_MM_MMU lwp_unmap_user_space(lwp); #endif + timer_list_free(&lwp->timer); level = rt_hw_interrupt_disable(); /* for children */ @@ -506,7 +507,6 @@ void lwp_free(struct rt_lwp* lwp) } } - timer_list_free(&lwp->timer); lwp_pid_put(lwp_to_pid(lwp)); rt_hw_interrupt_enable(level); rt_free(lwp); @@ -706,6 +706,7 @@ pid_t waitpid(pid_t pid, int *status, int options) } (*lwp_node) = lwp->sibling; lwp->parent = RT_NULL; + lwp_pid_put(pid); } quit: