-
Bug
-
Resolution: Fixed
-
Medium
-
OpenVX Framework
-
TIOVX-1753
-
TIOVX_09.02.00
-
TIOVX_10.00.00
-
j784s4-evm
tivxTaskDelete() returns VX_SUCCESS even if task /tsk_handle is NULL. So add an 'else' condition such that the status is set to 'VX_FAILURE' when the condition that checks whether task/ tsk_handle fails.
Below is the code snippet with the fix:
vx_status tivxTaskDelete(tivx_task *task) { vx_status status = (vx_status)VX_SUCCESS; if(task && task->tsk_handle) { tivx_task_context context; void *ret_val; context = (tivx_task_context)task->tsk_handle; (void)pthread_cancel(context->hndl); (void)pthread_join(context->hndl, &ret_val); status = ownPosixObjectFree((uint8_t*)context, (vx_enum)TIVX_POSIX_TYPE_TASK); #ifdef LDRA_UNTESTABLE_CODE /* TIOVX-1724- LDRA Uncovered Id: TIOVX_CODE_COVERAGE_TASK_UM002 */ if ((vx_status)VX_SUCCESS != status) { VX_PRINT(VX_ZONE_ERROR, "Task free failed\n"); } #endif task->tsk_handle = NULL; } else // BUG FIX { VX_PRINT(VX_ZONE_ERROR, "Task or task handle are NULL\n"); status = (vx_status)VX_FAILURE; } return (status); }