host: don't free empty buffer list

Don't free empty buffer list on host component free.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2018-09-27 17:32:29 +02:00
parent 81e8a33b58
commit 3a9652d839
1 changed files with 6 additions and 4 deletions

View File

@ -423,14 +423,16 @@ static void host_free(struct comp_dev *dev)
trace_host("fre");
elem = list_first_item(&hd->config.elem_list,
struct dma_sg_elem, list);
#if !defined CONFIG_DMA_GW
dma_channel_put(hd->dma, hd->chan);
#endif
if (!list_is_empty(&hd->config.elem_list)) {
elem = list_first_item(&hd->config.elem_list,
struct dma_sg_elem, list);
rfree(elem);
}
rfree(hd);
rfree(dev);
}