Skip to content

Commit d4e2b2b

Browse files
committed
audio: pipeline: guard against NULL source or sink in pipeline_copy()
When a pipeline is being stopped or unbound, the component unbind handler may clear pipeline->source_comp before the low-latency copy task finishes its final execution tick. Attempting to access p->source_comp->direction without checking for NULL triggers a synchronous PIF exception (DSP panic). Add NULL checks for p->source_comp and start before proceeding with the pipeline graph copy walk, returning 0 cleanly if the pipeline endpoints are no longer valid. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 158518d commit d4e2b2b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/audio/pipeline/pipeline-stream.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ int pipeline_copy(struct pipeline *p)
179179

180180
PPL_LOCK(p->core);
181181

182+
if (!p->source_comp) {
183+
PPL_UNLOCK();
184+
return 0;
185+
}
186+
182187
if (p->source_comp->direction == SOF_IPC_STREAM_PLAYBACK) {
183188
dir = PPL_DIR_UPSTREAM;
184189
start = p->sink_comp;
@@ -187,6 +192,11 @@ int pipeline_copy(struct pipeline *p)
187192
start = p->source_comp;
188193
}
189194

195+
if (!start) {
196+
PPL_UNLOCK();
197+
return 0;
198+
}
199+
190200
data.start = start;
191201
data.p = p;
192202

0 commit comments

Comments
 (0)