staging: android: ion: Initialize dma_address of new sg list
authorLiam Mark <lmark@codeaurora.org>
Fri, 16 Feb 2018 20:19:22 +0000 (12:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Feb 2018 08:05:35 +0000 (09:05 +0100)
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>
drivers/staging/android/ion/ion.c

index c094be2..74d9a4e 100644 (file)
@@ -182,7 +182,7 @@ static struct sg_table *dup_sg_table(struct sg_table *table)
        new_sg = new_table->sgl;
        for_each_sg(table->sgl, sg, table->nents, i) {
                memcpy(new_sg, sg, sizeof(*sg));
-               sg->dma_address = 0;
+               new_sg->dma_address = 0;
                new_sg = sg_next(new_sg);
        }