rtio: workq: Initialize Work item before using it
As the items come from the memory slab, their initialization state can't be guaranteed. This is causing some devices triggering an assert in p4wq where the item's thread is not null (not zero). Signed-off-by: Luis Ubieda <luisf@croxel.com>
This commit is contained in:
parent
792ae68165
commit
7d9ff8bcb4
1 changed files with 4 additions and 0 deletions
|
|
@ -42,6 +42,10 @@ struct rtio_work_req *rtio_work_req_alloc(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/** Initialize work item before using it as it comes
|
||||
* from a Memory slab (no-init region).
|
||||
*/
|
||||
req->work.thread = NULL;
|
||||
(void)k_sem_init(&req->work.done_sem, 1, 1);
|
||||
|
||||
return req;
|
||||
|
|
|
|||
Loading…
Reference in a new issue