diff --git a/sched/task/task_spawn.c b/sched/task/task_spawn.c index d5740c1eb7..327bf8c6f0 100644 --- a/sched/task/task_spawn.c +++ b/sched/task/task_spawn.c @@ -437,7 +437,7 @@ int task_spawn(FAR const char *name, main_t entry, goto errout_with_lock; } - return (int)pid; + ret = (int)pid; errout_with_lock: #ifdef CONFIG_SCHED_WAITPID