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

Commit 9733bd1f authored by Lior Barenboim's avatar Lior Barenboim
Browse files

msm8994: audio: use correct length in msm_audio_ion_mmap



When compiling for msm8994 the dma_length field is set to 0,
making the use of the sg_dma_len() macro incorrect.

Instead of using this macro, we use the length field directly.

Change-Id: I75ce78243f02e1b2c540a03f7f44dbc5c106dba3
Acked-by: default avatarHadar Sivan <hsivan@qti.qualcomm.com>
Signed-off-by: default avatarLior Barenboim <liorb@codeaurora.org>
parent 9f25a3ef
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);