From d87b81e670a2257ee50964cf2d32ea6a0ccbbc9f Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Wed, 4 Jul 2018 16:36:36 +0800 Subject: [PATCH] ipc: fix list uninit in handler Need not to skip phost if we did not have phost and move init before skip. Signed-off-by: Pan Xiuli --- src/ipc/handler.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ipc/handler.c b/src/ipc/handler.c index 9737141e8bb5..3c85097d5149 100644 --- a/src/ipc/handler.c +++ b/src/ipc/handler.c @@ -87,6 +87,7 @@ static inline struct sof_ipc_hdr *mailbox_validate(void) return hdr; } +#ifdef CONFIG_HOST_PTABLE /* check if a pipeline is hostless when walking downstream */ static bool is_hostless_downstream(struct comp_dev *current) { @@ -151,6 +152,7 @@ static bool is_hostless_upstream(struct comp_dev *current) return true; } +#endif /* * Stream IPC Operations. @@ -200,6 +202,9 @@ static int ipc_stream_pcm_params(uint32_t stream) cd = pcm_dev->cd; cd->params = pcm_params->params; +#ifdef CONFIG_HOST_PTABLE + list_init(&elem_list); + /* * walk in both directions to check if the pipeline is hostless * skip page table set up if it is @@ -207,9 +212,6 @@ static int ipc_stream_pcm_params(uint32_t stream) if (is_hostless_downstream(cd) && is_hostless_upstream(cd)) goto pipe_params; -#ifdef CONFIG_HOST_PTABLE - list_init(&elem_list); - /* use DMA to read in compressed page table ringbuffer from host */ err = ipc_get_page_descriptors(iipc->dmac, iipc->page_table, &pcm_params->params.buffer); @@ -242,9 +244,9 @@ static int ipc_stream_pcm_params(uint32_t stream) list_item_del(&elem->list); rfree(elem); } -#endif pipe_params: +#endif /* configure pipeline audio params */ err = pipeline_params(pcm_dev->cd->pipeline, pcm_dev->cd, pcm_params);