diff --git a/binfmt/binfmt_execmodule.c b/binfmt/binfmt_execmodule.c index eef50068a53..d5fd06771c5 100644 --- a/binfmt/binfmt_execmodule.c +++ b/binfmt/binfmt_execmodule.c @@ -276,7 +276,10 @@ int exec_module(FAR const struct binary_s *binp) * until the new task has been started. */ - task_starthook(tcb, exec_ctors, (FAR void *)binp); + if (binp->nctors > 0) + { + task_starthook(tcb, exec_ctors, (FAR void *)binp); + } #endif /* Get the assigned pid before we start the task */ diff --git a/configs/stm32f4discovery/src/stm32_bringup.c b/configs/stm32f4discovery/src/stm32_bringup.c index 0997c941389..22fbf97830b 100644 --- a/configs/stm32f4discovery/src/stm32_bringup.c +++ b/configs/stm32f4discovery/src/stm32_bringup.c @@ -68,7 +68,7 @@ #include "stm32f4discovery.h" -/* Conditional logic in stm32f4discover.h will determine if certain features +/* Conditional logic in stm32f4discovery.h will determine if certain features * are supported. Tests for these features need to be made after including * stm32f4discovery.h. */ diff --git a/sched/task/task_start.c b/sched/task/task_start.c index 262c8f0b729..b1f1e3cd1a8 100644 --- a/sched/task/task_start.c +++ b/sched/task/task_start.c @@ -89,7 +89,7 @@ void task_start(void) /* Execute the start hook if one has been registered */ #ifdef CONFIG_SCHED_STARTHOOK - if (tcb->starthook) + if (tcb->starthook != NULL) { tcb->starthook(tcb->starthookarg); }