Skip to content
Open
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
9 changes: 8 additions & 1 deletion src/schedule/zephyr_dp_schedule_application.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ static void scheduler_dp_domain_free(struct task_dp_pdata *pdata)

/* All partitions removed, the domain can be freed now */
pmod->mdom = NULL;
k_mem_domain_deinit(mdom);
objpool_free(&dp_mdom_head, mdom);
Comment on lines 388 to 391
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lyakh can you resolve this, I think we are good then.

Copy link
Copy Markdown
Collaborator Author

@lyakh lyakh May 6, 2026

Choose a reason for hiding this comment

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

@lgirdwood changed to not call scheduler_dp_domain_free() when domain initialisation fails

}

Expand Down Expand Up @@ -506,6 +507,7 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
unsigned int pidx;
size_t size;
uintptr_t start;
bool on_pool = false;
struct k_mem_domain *mdom = objpool_alloc(&dp_mdom_head, sizeof(*mdom),
SOF_MEM_FLAG_COHERENT);

Expand All @@ -515,12 +517,14 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
goto e_thread;
}

on_pool = true;

mod->mdom = mdom;

if (!mdom->arch.ptables) {
ret = k_mem_domain_init(mdom, 0, NULL);
if (ret < 0)
goto e_dom;
goto e_thread;
}

/* Module heap partition */
Expand Down Expand Up @@ -577,7 +581,10 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,

e_dom:
scheduler_dp_domain_free(pdata);
on_pool = false;
e_thread:
if (on_pool)
objpool_free(&dp_mdom_head, mdom);
k_thread_abort(pdata->thread_id);
e_kobj:
/* k_object_free looks for a pointer in the list, any invalid value can be passed */
Expand Down
Loading