Pārlūkot izejas kodu

Merge "dsp: address memleak in msm_audio_ion_map_kernel"

qctecmdr 2 gadi atpakaļ
vecāks
revīzija
9ef29aa716
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      dsp/msm_audio_ion.c

+ 2 - 0
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);