diff --git a/sched/task/task_exithook.c b/sched/task/task_exithook.c index c0a0b31d69a..7a9f02b5bb5 100644 --- a/sched/task/task_exithook.c +++ b/sched/task/task_exithook.c @@ -409,6 +409,17 @@ static inline void nxtask_exitwakeup(FAR struct tcb_s *tcb, int status) void nxtask_exithook(FAR struct tcb_s *tcb, int status) { +#ifdef CONFIG_SCHED_DUMP_LEAK + struct mm_memdump_s dump = + { + tcb->pid, +# if CONFIG_MM_BACKTRACE >= 0 + 0, + ULONG_MAX +# endif + }; +#endif + /* Under certain conditions, nxtask_exithook() can be called multiple * times. A bit in the TCB was set the first time this function was * called. If that bit is set, then just exit doing nothing more.. @@ -463,11 +474,11 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status) #ifdef CONFIG_SCHED_DUMP_LEAK if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_KERNEL) { - kmm_memdump(tcb->pid); + kmm_memdump(&dump); } else { - umm_memdump(tcb->pid); + umm_memdump(&dump); } #endif