diff --git a/src/transport/multicast/lease.c b/src/transport/multicast/lease.c index 4a56a9c39..ad82c2889 100644 --- a/src/transport/multicast/lease.c +++ b/src/transport/multicast/lease.c @@ -77,14 +77,13 @@ int8_t _zp_multicast_send_keep_alive(_z_transport_multicast_t *ztm) { 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 12073d0ce..c080f42e0 100644 --- a/src/transport/multicast/read.c +++ b/src/transport/multicast/read.c @@ -42,14 +42,13 @@ int8_t _zp_multicast_read(_z_transport_multicast_t *ztm) { 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 668b650f5..49a864b94 100644 --- a/src/transport/raweth/read.c +++ b/src/transport/raweth/read.c @@ -42,14 +42,13 @@ int8_t _zp_raweth_read(_z_transport_multicast_t *ztm) { 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 8fde5868e..a204a6bdc 100644 --- a/src/transport/unicast/lease.c +++ b/src/transport/unicast/lease.c @@ -32,14 +32,13 @@ int8_t _zp_unicast_send_keep_alive(_z_transport_unicast_t *ztu) { 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 02b95ddef..43c0861d7 100644 --- a/src/transport/unicast/read.c +++ b/src/transport/unicast/read.c @@ -39,14 +39,13 @@ int8_t _zp_unicast_read(_z_transport_unicast_t *ztu) { 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; }