Skip to content

Commit 0d7e66d

Browse files
committed
schedule: ll: initialise task object to 0
This is needed at least to set the .priv_data pointer to NULL. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 9481526 commit 0d7e66d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/schedule/zephyr_ll.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,14 @@ static const struct scheduler_ops zephyr_ll_ops = {
552552
#if CONFIG_SOF_USERSPACE_LL
553553
struct task *zephyr_ll_task_alloc(void)
554554
{
555-
return sof_heap_alloc(zephyr_ll_user_heap(), SOF_MEM_FLAG_USER,
556-
sizeof(struct task), sizeof(void *));
555+
struct task *task = sof_heap_alloc(zephyr_ll_user_heap(), SOF_MEM_FLAG_USER,
556+
sizeof(*task), sizeof(void *));
557+
558+
if (task)
559+
/* At least .priv_data must be NULL for zephyr_ll_task_init() */
560+
memset(task, 0, sizeof(*task));
561+
562+
return task;
557563
}
558564
#endif /* CONFIG_SOF_USERSPACE_LL */
559565

0 commit comments

Comments
 (0)