From 1bf0574b2952564ca14a98721b75a2667fe098e2 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 18 Aug 2020 16:02:36 -0400 Subject: [PATCH] Fix #565, propagate return code from OS_TaskRegister_Impl() If this routine fails then return the error to the caller, which will also prevent the task from starting. --- src/os/shared/src/osapi-task.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/shared/src/osapi-task.c b/src/os/shared/src/osapi-task.c index 912b0ff86..bb78f1623 100644 --- a/src/os/shared/src/osapi-task.c +++ b/src/os/shared/src/osapi-task.c @@ -116,9 +116,10 @@ static int32 OS_TaskPrepare(uint32 task_id, osal_task_entry *entrypt) if (return_code == OS_SUCCESS) { - OS_TaskRegister_Impl(task_id); + return_code = OS_TaskRegister_Impl(task_id); } - else + + if (return_code != OS_SUCCESS) { *entrypt = NULL; }