Skip to content

Commit

Permalink
sparc64: zero out dma_length
Browse files Browse the repository at this point in the history
zero out dma_length in the entry immediately following the last mapped
entry for unmap_sg.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Oct 23, 2007
1 parent 83fcaf7 commit cb92ae8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/sparc64/kernel/iommu_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ unsigned long prepare_sg(struct scatterlist *sg, int nents)
dma_sg->dma_address = dent_addr;
dma_sg->dma_length = dent_len;

if (dma_sg != sg) {
dma_sg = next_sg(dma_sg);
dma_sg->dma_length = 0;
}

return ((unsigned long) dent_addr +
(unsigned long) dent_len +
(IO_PAGE_SIZE - 1UL)) >> IO_PAGE_SHIFT;
Expand Down

0 comments on commit cb92ae8

Please sign in to comment.