Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/audio/chain_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ static enum task_state chain_task_run(void *data)
uint32_t link_type;
int ret;

if (!cd || !cd->dma_buffer || !cd->chan_link || !cd->chan_host)
return SOF_TASK_STATE_COMPLETED;

/* Link DMA can return -EPIPE and current status if xrun occurs, then it is not critical
* and flow shall continue. Other error values will be treated as critical.
*/
Expand Down
8 changes: 7 additions & 1 deletion src/schedule/zephyr_dp_schedule_application.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,20 @@ static void ipc_thread_unflatten_run(struct processing_module *pmod, struct ipc4
int scheduler_dp_thread_ipc(struct processing_module *pmod, unsigned int cmd,
const union scheduler_dp_thread_ipc_param *param)
{
struct task_dp_pdata *pdata = pmod->dev->task->priv_data;
int ret;

if (!pmod) {
tr_err(&dp_tr, "no thread module");
return -EINVAL;
}

if (!pmod->dev || !pmod->dev->task || !pmod->dev->task->priv_data) {
tr_err(&dp_tr, "no thread task or pdata");
return -EINVAL;
}

struct task_dp_pdata *pdata = pmod->dev->task->priv_data;

if (cmd == SOF_IPC4_MOD_INIT_INSTANCE) {
/* Wait for the DP thread to start */
ret = k_sem_take(&dp_sync[pmod->dev->task->core], DP_THREAD_IPC_TIMEOUT);
Expand Down
14 changes: 11 additions & 3 deletions src/schedule/zephyr_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void zephyr_ll_task_done(struct zephyr_ll *sch,

task->state = SOF_TASK_STATE_FREE;

if (pdata->freeing)
if (pdata && pdata->freeing)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than checking here, could this be fixed at source to ensure the data is valid through the life cycle of zephyr_ll_task_free() ?

/*
* zephyr_ll_task_free() is trying to free this task. Complete
* it and signal the semaphore to let the function proceed
Expand Down Expand Up @@ -297,8 +297,9 @@ static void zephyr_ll_run(void *data)
#ifndef CONFIG_SOF_USERSPACE_LL
zephyr_ll_lock(sch, &flags);
#endif
pdata = task->priv_data;

if (pdata->freeing || state == SOF_TASK_STATE_COMPLETED) {
if (!pdata || pdata->freeing || state == SOF_TASK_STATE_COMPLETED) {
zephyr_ll_task_done(sch, task);
} else {
/*
Expand Down Expand Up @@ -457,9 +458,16 @@ static int zephyr_ll_task_free(void *data, struct task *task)
{
struct zephyr_ll *sch = data;
uint32_t flags;
struct zephyr_ll_pdata *pdata = task->priv_data;
struct zephyr_ll_pdata *pdata;
bool must_wait, on_list = true;

if (!task)
return 0;

pdata = task->priv_data;
if (!pdata)
return 0;

zephyr_ll_assert_core(sch);

#ifndef CONFIG_SOF_USERSPACE_LL
Expand Down
Loading