Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af07c85c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm8994: audio: use correct length in msm_audio_ion_mmap"

parents d0202326 9733bd1f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -250,16 +250,16 @@ int msm_audio_ion_mmap(struct audio_buffer *ab,
		pr_debug("%s: page is NOT null\n", __func__);
		for_each_sg(table->sgl, sg, table->nents, i) {
			unsigned long remainder = vma->vm_end - addr;
			unsigned long len = sg_dma_len(sg);
			unsigned long len = sg->length;

			page = sg_page(sg);

			if (offset >= sg_dma_len(sg)) {
				offset -= sg_dma_len(sg);
			if (offset >= len) {
				offset -= len;
				continue;
			} else if (offset) {
				page += offset / PAGE_SIZE;
				len = sg_dma_len(sg) - offset;
				len -= offset;
				offset = 0;
			}
			len = min(len, remainder);