Skip to content

Commit 7d9ff8b

Browse files
ubiedanashif
authored andcommitted
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 <[email protected]>
1 parent 792ae68 commit 7d9ff8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/rtio/rtio_workq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ struct rtio_work_req *rtio_work_req_alloc(void)
4242
return NULL;
4343
}
4444

45+
/** Initialize work item before using it as it comes
46+
* from a Memory slab (no-init region).
47+
*/
48+
req->work.thread = NULL;
4549
(void)k_sem_init(&req->work.done_sem, 1, 1);
4650

4751
return req;

0 commit comments

Comments
 (0)