host: Clean up state on component reset

Clean up host state data in hd->config in component data on reset().

Signed-off-by: Eddy Hsu <eddyhsu@chromium.org>
This commit is contained in:
Eddy Hsu 2022-04-21 20:32:10 +00:00 committed by Liam Girdwood
parent 3f2f2ff32d
commit 1c136b1d2f
1 changed files with 3 additions and 0 deletions

View File

@ -970,6 +970,9 @@ static int host_reset(struct comp_dev *dev)
dma_sg_free(&hd->local.elem_array);
dma_sg_free(&hd->config.elem_array);
/* It's safe that cleaning out `hd->config` after `dma_sg_free` for config.elem_array */
memset(&hd->config, 0, sizeof(hd->config));
/* free DMA buffer */
if (hd->dma_buffer) {
buffer_free(hd->dma_buffer);