diff --git a/src/transport/multicast/lease.c b/src/transport/multicast/lease.c index 8ab532bee..2d3a0d496 100644 --- a/src/transport/multicast/lease.c +++ b/src/transport/multicast/lease.c @@ -184,14 +184,13 @@ void *_zp_multicast_lease_task(void *ztm_arg) { int8_t _zp_multicast_start_lease_task(_z_transport_multicast_t *ztm, _z_task_attr_t *attr, _z_task_t *task) { // Init memory (void)memset(task, 0, sizeof(_z_task_t)); - // Attach task - ztm->_lease_task = task; - ztm->_lease_task_running = true; // Init task if (_z_task_init(task, attr, _zp_multicast_lease_task, ztm) != _Z_RES_OK) { - ztm->_lease_task_running = false; return _Z_ERR_SYSTEM_TASK_FAILED; } + // Attach task + ztm->_lease_task = task; + ztm->_lease_task_running = true; return _Z_RES_OK; } diff --git a/src/transport/multicast/read.c b/src/transport/multicast/read.c index 8081d1fcc..6d50f580d 100644 --- a/src/transport/multicast/read.c +++ b/src/transport/multicast/read.c @@ -131,14 +131,13 @@ void *_zp_multicast_read_task(void *ztm_arg) { int8_t _zp_multicast_start_read_task(_z_transport_t *zt, _z_task_attr_t *attr, _z_task_t *task) { // Init memory (void)memset(task, 0, sizeof(_z_task_t)); - // Attach task - zt->_transport._multicast._read_task = task; - zt->_transport._multicast._read_task_running = true; // Init task if (_z_task_init(task, attr, _zp_multicast_read_task, &zt->_transport._multicast) != _Z_RES_OK) { - zt->_transport._multicast._read_task_running = false; return _Z_ERR_SYSTEM_TASK_FAILED; } + // Attach task + zt->_transport._multicast._read_task = task; + zt->_transport._multicast._read_task_running = true; return _Z_RES_OK; } diff --git a/src/transport/raweth/read.c b/src/transport/raweth/read.c index 49680e6b0..11cb7141a 100644 --- a/src/transport/raweth/read.c +++ b/src/transport/raweth/read.c @@ -86,14 +86,13 @@ void *_zp_raweth_read_task(void *ztm_arg) { int8_t _zp_raweth_start_read_task(_z_transport_t *zt, _z_task_attr_t *attr, _z_task_t *task) { // Init memory (void)memset(task, 0, sizeof(_z_task_t)); - // Attach task - zt->_transport._raweth._read_task = task; - zt->_transport._raweth._read_task_running = true; // Init task if (_z_task_init(task, attr, _zp_raweth_read_task, &zt->_transport._raweth) != _Z_RES_OK) { - zt->_transport._raweth._read_task_running = false; return _Z_ERR_SYSTEM_TASK_FAILED; } + // Attach task + zt->_transport._raweth._read_task = task; + zt->_transport._raweth._read_task_running = true; return _Z_RES_OK; } diff --git a/src/transport/unicast/lease.c b/src/transport/unicast/lease.c index 5ef50565b..cd63416f5 100644 --- a/src/transport/unicast/lease.c +++ b/src/transport/unicast/lease.c @@ -98,14 +98,13 @@ void *_zp_unicast_lease_task(void *ztu_arg) { int8_t _zp_unicast_start_lease_task(_z_transport_t *zt, _z_task_attr_t *attr, _z_task_t *task) { // Init memory (void)memset(task, 0, sizeof(_z_task_t)); - // Attach task - zt->_transport._unicast._lease_task = task; - zt->_transport._unicast._lease_task_running = true; // Init task if (_z_task_init(task, attr, _zp_unicast_lease_task, &zt->_transport._unicast) != _Z_RES_OK) { - zt->_transport._unicast._lease_task_running = false; return _Z_ERR_SYSTEM_TASK_FAILED; } + // Attach task + zt->_transport._unicast._lease_task = task; + zt->_transport._unicast._lease_task_running = true; return _Z_RES_OK; } diff --git a/src/transport/unicast/read.c b/src/transport/unicast/read.c index a62fa2474..36598118a 100644 --- a/src/transport/unicast/read.c +++ b/src/transport/unicast/read.c @@ -124,14 +124,13 @@ void *_zp_unicast_read_task(void *ztu_arg) { int8_t _zp_unicast_start_read_task(_z_transport_t *zt, _z_task_attr_t *attr, _z_task_t *task) { // Init memory (void)memset(task, 0, sizeof(_z_task_t)); - // Attach task - zt->_transport._unicast._read_task = task; - zt->_transport._unicast._read_task_running = true; // Init task if (_z_task_init(task, attr, _zp_unicast_read_task, &zt->_transport._unicast) != _Z_RES_OK) { - zt->_transport._unicast._read_task_running = false; return _Z_ERR_SYSTEM_TASK_FAILED; } + // Attach task + zt->_transport._unicast._read_task = task; + zt->_transport._unicast._read_task_running = true; return _Z_RES_OK; }