sched: handle nxtask_setup_arguments return values
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
1f854486c3
commit
db08f3a723
@ -157,7 +157,11 @@ int nxtask_init(FAR struct task_tcb_s *tcb, const char *name, int priority,
|
|||||||
|
|
||||||
/* Setup to pass parameters to the new task */
|
/* Setup to pass parameters to the new task */
|
||||||
|
|
||||||
nxtask_setup_arguments(tcb, name, argv);
|
ret = nxtask_setup_arguments(tcb, name, argv);
|
||||||
|
if (ret < OK)
|
||||||
|
{
|
||||||
|
goto errout_with_group;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now we have enough in place that we can join the group */
|
/* Now we have enough in place that we can join the group */
|
||||||
|
|
||||||
|
@ -545,6 +545,7 @@ static int nxtask_setup_stackargs(FAR struct task_tcb_s *tcb,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
strtablen += (strlen(argv[argc]) + 1);
|
strtablen += (strlen(argv[argc]) + 1);
|
||||||
|
DEBUGASSERT(strtablen < tcb->cmn.adj_stack_size);
|
||||||
if (strtablen >= tcb->cmn.adj_stack_size)
|
if (strtablen >= tcb->cmn.adj_stack_size)
|
||||||
{
|
{
|
||||||
return -ENAMETOOLONG;
|
return -ENAMETOOLONG;
|
||||||
@ -556,6 +557,7 @@ static int nxtask_setup_stackargs(FAR struct task_tcb_s *tcb,
|
|||||||
* happens in normal usage.
|
* happens in normal usage.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
DEBUGASSERT(argc <= MAX_STACK_ARGS);
|
||||||
if (++argc > MAX_STACK_ARGS)
|
if (++argc > MAX_STACK_ARGS)
|
||||||
{
|
{
|
||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
|
@ -204,8 +204,12 @@ FAR struct task_tcb_s *nxtask_setup_vfork(start_t retaddr)
|
|||||||
|
|
||||||
/* Setup to pass parameters to the new task */
|
/* Setup to pass parameters to the new task */
|
||||||
|
|
||||||
nxtask_setup_arguments(child, parent->group->tg_info->argv[0],
|
ret = nxtask_setup_arguments(child, parent->group->tg_info->argv[0],
|
||||||
&parent->group->tg_info->argv[1]);
|
&parent->group->tg_info->argv[1]);
|
||||||
|
if (ret < OK)
|
||||||
|
{
|
||||||
|
goto errout_with_tcb;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now we have enough in place that we can join the group */
|
/* Now we have enough in place that we can join the group */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user