library_manager: fix dma_deinit order

Fixes commit f90f5f9a14
dma ptr should be checked before dma->z_dev

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
This commit is contained in:
Adrian Bonislawski 2022-12-09 14:01:37 +01:00 committed by Liam Girdwood
parent f0a14a3f41
commit 7c623256cb
1 changed files with 2 additions and 1 deletions

View File

@ -464,9 +464,10 @@ static int lib_manager_dma_init(struct lib_manager_dma_ext *dma_ext, uint32_t dm
static int lib_manager_dma_deinit(struct lib_manager_dma_ext *dma_ext, uint32_t dma_id)
{
if (dma_ext->dma) {
dma_put(dma_ext->dma);
if (dma_ext->dma->z_dev)
dma_release_channel(dma_ext->dma->z_dev, dma_id);
dma_put(dma_ext->dma);
}
return 0;
}