From 256b05b2b03aa282dfbe335f7c5905e8f720bf75 Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Thu, 13 Feb 2020 14:15:01 -0800 Subject: [PATCH] ASoC: msm: unmap and free dma memory if smmu map failed Unmap and free DMA memory in case of ION SMMU mapping failure from PVM backend or MMHAB. Change-Id: I2d2780941ba6922534654afa463a011f27ef7c66 Signed-off-by: Derek Chen --- dsp/msm_audio_ion_vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dsp/msm_audio_ion_vm.c b/dsp/msm_audio_ion_vm.c index f9635b3328d1..a84403750574 100644 --- a/dsp/msm_audio_ion_vm.c +++ b/dsp/msm_audio_ion_vm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. */ #include @@ -564,6 +564,7 @@ static int msm_audio_ion_map_buf(void *handle, dma_addr_t *paddr, if (rc) { pr_err("%s: failed to do smmu map, err = %d\n", __func__, rc); + msm_audio_dma_buf_unmap((struct dma_buf *) handle); goto err; } }