From 88aa5542a41b974f1cd79e2f4d436032496034cd Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Tue, 19 Feb 2019 13:22:23 +0100 Subject: [PATCH] ipc: fix getting source component Fixes getting source component, when it's the one connected to the other pipeline. Signed-off-by: Tomasz Lauda --- src/ipc/ipc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ipc/ipc.c b/src/ipc/ipc.c index 114c7dcc6..101f7bcda 100644 --- a/src/ipc/ipc.c +++ b/src/ipc/ipc.c @@ -99,9 +99,11 @@ static struct ipc_comp_dev *ipc_get_ppl_src_comp(struct ipc *ipc, icd = container_of(clist, struct ipc_comp_dev, list); if (icd->type == COMP_TYPE_COMPONENT && icd->cd->comp.pipeline_id == pipeline_id) { - buffer = container_of(icd->cd->bsource_list.next, - struct comp_buffer, sink_list); - if (buffer->source->comp.pipeline_id != pipeline_id) + buffer = list_first_item(&icd->cd->bsource_list, + struct comp_buffer, + sink_list); + if (buffer && buffer->source && + buffer->source->comp.pipeline_id != pipeline_id) return icd; } }