Skip to content

Commit f33d7e2

Browse files
fujitatorvalds
authored andcommitted
dma-mapping: fix dma_sync_single_range_*
dma_sync_single_range_for_cpu() and dma_sync_single_range_for_device() use a wrong address with a partial synchronization. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent fc2a093 commit f33d7e2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/asm-generic/dma-mapping-common.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
131131
debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
132132

133133
} else
134-
dma_sync_single_for_cpu(dev, addr, size, dir);
134+
dma_sync_single_for_cpu(dev, addr + offset, size, dir);
135135
}
136136

137137
static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -148,7 +148,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
148148
debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
149149

150150
} else
151-
dma_sync_single_for_device(dev, addr, size, dir);
151+
dma_sync_single_for_device(dev, addr + offset, size, dir);
152152
}
153153

154154
static inline void

0 commit comments

Comments
 (0)