chain dma: fix oops at stream close#11030
Open
lgirdwood wants to merge 3 commits into
Open
Conversation
… during task free When a task is freed by zephyr_ll_task_free(), zephyr_ll_run() can still hold a reference to the task's pdata structure across the LL lock boundary. Re-fetching task->priv_data under zephyr_ll_lock() prevents evaluating pdata->freeing on a stale/freed pointer. Additionally, add NULL checks for pdata in zephyr_ll_task_done() and task/pdata in zephyr_ll_task_free(). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…p_thread_ipc Move task_dp_pdata assignment after checking pmod and validate pmod->dev, pmod->dev->task, and pmod->dev->task->priv_data pointers before dereferencing to prevent NULL pointer crashes. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Validate cd, cd->dma_buffer, cd->chan_link, and cd->chan_host at the start of chain_task_run() to handle stream teardown cleanly when buffers or channels are freed before task completion. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
lgirdwood
requested review from
LaurentiuM1234,
dbaluta,
kv2019i,
lbetlej,
marcinszkudlinski,
mmaka1,
pblaszko and
plbossart
as code owners
July 23, 2026 15:04
lgirdwood
commented
Jul 23, 2026
| task->state = SOF_TASK_STATE_FREE; | ||
|
|
||
| if (pdata->freeing) | ||
| if (pdata && pdata->freeing) |
Member
Author
There was a problem hiding this comment.
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() ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some of this duplicates @lyakh PR, but agent provided some additional patches to prevent the NULL deref. Test in CI now and review comments will be folded before merge. Likely drop 1/3 in favour of @lyakh update.