summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShell <[email protected]>2023-10-13 14:21:06 +0800
committerGitHub <[email protected]>2023-10-13 14:21:06 +0800
commit8e57b5fdd4636b3b3a39f78cbd3f4cbc6396b207 (patch)
tree42d3b9283be72a6d7aca785d757b2d0b1ddf4b0d
parent6c1537c216de0015746711164acb0871a1da3ef9 (diff)
[smart] fixup: lwp_free() (#8126)
Signed-off-by: shell <[email protected]>
-rw-r--r--components/lwp/lwp_pid.c3
1 files changed, 2 insertions, 1 deletions
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: