diff --git a/sched/group/group_childstatus.c b/sched/group/group_childstatus.c index 4b9cb086c2..dfc3a0bd88 100644 --- a/sched/group/group_childstatus.c +++ b/sched/group/group_childstatus.c @@ -156,8 +156,7 @@ void task_initialize(void) * * Returned Value: * On success, a non-NULL pointer to a child status structure. NULL is - * returned if there are no remaining, pre-allocated child status - * structures. + * returned when memory allocation fails. * * Assumptions: * Called during task creation in a safe context. No special precautions @@ -177,6 +176,10 @@ FAR struct child_status_s *group_alloc_child(void) g_child_pool.freelist = ret->flink; ret->flink = NULL; } + else + { + ret = kmm_zalloc(sizeof(*ret)); + } return ret; }