Commit f367528
committed
audio: mux: Fix incorrect iterator in demux_trigger
demux_trigger() checks for cross-pipeline sinks to set the overrun_permitted
flag. Commit 96b4fdb ("buf: use API for iteration bsource_list in
components") incorrectly converted the bsink_list iteration to
comp_dev_for_each_producer instead of comp_dev_for_each_consumer.
Since demux has 1 input and multiple outputs, the loop must iterate over
consumers (sinks), not producers (sources). The incorrect iterator caused
the pipeline comparison to never match, making audio_stream_set_overrun()
unreachable.
Fix by using comp_dev_for_each_consumer with comp_buffer_get_sink_component
and add a defensive NULL check on the returned component pointer.
Issue found using semgrep with custom rules.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>1 parent accf902 commit f367528
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
293 | 294 | | |
294 | | - | |
295 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
| |||
0 commit comments