Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: android: ion: Initialize dma_address of new sg list

Fix the dup_sg_table function to initialize the dma_address of the new
sg list entries instead of the source dma_address entries.

Since ION duplicates the sg_list this issue does not appear to result in
an actual bug.

Signed-off-by: Liam Mark <lmark@codeaurora.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Liam Mark and committed by
Greg Kroah-Hartman
54ef5b9d 2baddf26

+1 -1
+1 -1
drivers/staging/android/ion/ion.c
··· 182 182 new_sg = new_table->sgl; 183 183 for_each_sg(table->sgl, sg, table->nents, i) { 184 184 memcpy(new_sg, sg, sizeof(*sg)); 185 - sg->dma_address = 0; 185 + new_sg->dma_address = 0; 186 186 new_sg = sg_next(new_sg); 187 187 } 188 188