-
Notifications
You must be signed in to change notification settings - Fork 371
audio: pipeline: guard against NULL source or sink in pipeline_copy() #11184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,11 @@ int pipeline_copy(struct pipeline *p) | |
|
|
||
| PPL_LOCK(p->core); | ||
|
|
||
| if (!p->source_comp) { | ||
| PPL_UNLOCK(); | ||
| return 0; | ||
| } | ||
|
|
||
| if (p->source_comp->direction == SOF_IPC_STREAM_PLAYBACK) { | ||
|
Comment on lines
+183
to
187
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is valid. Pipeline execution and IPC handling (that modifes the graph) is never run concurrnetly. IPC actions are run when LL pipelines are not run. So I think this is safe.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@kv2019i not sure I understand you correctly. Maybe you mean a narrow set of cases. In general it is very much possible: LL and IPC can run on different cores (in all combinations: primary IPC, secondary LL, or the opposite, or both on secondary cores), and IPC can be preempted by LL on the same core. Could you clarify? |
||
| dir = PPL_DIR_UPSTREAM; | ||
| start = p->sink_comp; | ||
|
|
@@ -187,6 +192,11 @@ int pipeline_copy(struct pipeline *p) | |
| start = p->source_comp; | ||
| } | ||
|
|
||
| if (!start) { | ||
| PPL_UNLOCK(); | ||
| return 0; | ||
| } | ||
|
|
||
| data.start = start; | ||
| data.p = p; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style not, a "goto err: " to common exit with PPL_UNLOCK would look a bit better (but would require initializing ret to something). Given single-line cleanup, not a blocker.