diff --git a/dsp/msm_audio_ion.c b/dsp/msm_audio_ion.c index fef55e3213..099ebfe937 100644 --- a/dsp/msm_audio_ion.c +++ b/dsp/msm_audio_ion.c @@ -120,6 +120,7 @@ static int msm_audio_ion_map_kernel(struct dma_buf *dma_buf, if (rc) { pr_err("%s: kernel mapping of dma_buf failed\n", __func__); + dma_buf_end_cpu_access(dma_buf, DMA_BIDIRECTIONAL); goto exit; } @@ -205,6 +206,7 @@ static int msm_audio_dma_buf_map(struct dma_buf *dma_buf, alloc_data->vmap = iosys_vmap; } else { *addr = MSM_AUDIO_ION_PHYS_ADDR(alloc_data); + kfree(iosys_vmap); } msm_audio_ion_add_allocation(ion_data, alloc_data);