Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions src/audio/pipeline/pipeline-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,10 @@ struct comp_dev *pipeline_get_dai_comp(uint32_t pipeline_id, int dir)
buffer = buffer_from_list(blist->next, dir);
comp = buffer_get_comp(buffer, dir);

/* buffer_comp is in another pipeline and it is not complete */
if (!comp->pipeline)
/* A half-connected buffer has no peer component on this side, or
* buffer_comp is in another pipeline and it is not complete.
*/
Comment thread
tmleman marked this conversation as resolved.
if (!comp || !comp->pipeline)
return NULL;

crt = ipc_get_ppl_comp(ipc, comp->pipeline->pipeline_id, dir);
Expand Down
13 changes: 10 additions & 3 deletions src/audio/selector/selector.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ static int selector_cmd(struct comp_dev *dev, int cmd, void *data,
static int selector_trigger(struct comp_dev *dev, int cmd)
{
struct comp_buffer *sourceb;
enum sof_comp_type type;
struct comp_dev *source_comp;
int ret;

comp_dbg(dev, "entry");
Expand All @@ -423,16 +423,23 @@ static int selector_trigger(struct comp_dev *dev, int cmd)
}

ret = comp_set_state(dev, cmd);
if (ret < 0)
return ret;
if (ret == COMP_STATUS_STATE_ALREADY_SET)
ret = 0;

/* TODO: remove in the future after adding support for case when
* kpb_init_draining() and kpb_draining_task() are interrupted by
* new pipeline_task()
*/
type = dev_comp_type(comp_buffer_get_source_component(sourceb));
/* The source buffer may be present without an attached producer
* component (e.g. a partially connected pipeline), so guard against a
* NULL source component before dereferencing it.
*/
source_comp = comp_buffer_get_source_component(sourceb);

return type == SOF_COMP_KPB ? PPL_STATUS_PATH_TERMINATE : ret;
return source_comp && dev_comp_type(source_comp) == SOF_COMP_KPB ?
PPL_STATUS_PATH_TERMINATE : ret;
}

/**
Expand Down
Loading