mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
sched: Change the return type of nxtask_activate to void
to simplify the error handling logic Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I00fedd4d69620a7cc7b9f9e8bf4ba7f7989dc2b2
This commit is contained in:
committed by
Abdelatif Guettouche
parent
b4bd9427f7
commit
a69678810d
@@ -198,7 +198,7 @@ int exec_module(FAR const struct binary_s *binp)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_SHM)
|
||||
#ifdef CONFIG_MM_SHM
|
||||
/* Initialize the shared memory virtual page allocator */
|
||||
|
||||
ret = shm_group_initialize(tcb->cmn.group);
|
||||
@@ -254,12 +254,7 @@ int exec_module(FAR const struct binary_s *binp)
|
||||
|
||||
/* Then activate the task at the provided priority */
|
||||
|
||||
ret = nxtask_activate((FAR struct tcb_s *)tcb);
|
||||
if (ret < 0)
|
||||
{
|
||||
berr("nxtask_activate() failed: %d\n", ret);
|
||||
goto errout_with_tcbinit;
|
||||
}
|
||||
nxtask_activate((FAR struct tcb_s *)tcb);
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
|
||||
/* Restore the address environment of the caller */
|
||||
@@ -274,11 +269,13 @@ int exec_module(FAR const struct binary_s *binp)
|
||||
|
||||
return (int)pid;
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) || defined(CONFIG_MM_SHM)
|
||||
errout_with_tcbinit:
|
||||
tcb->cmn.stack_alloc_ptr = NULL;
|
||||
nxsched_release_tcb(&tcb->cmn, TCB_FLAG_TTYPE_TASK);
|
||||
kumm_free(stack);
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
errout_with_addrenv:
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
|
||||
|
||||
Reference in New Issue
Block a user