Thread (37 messages) 37 messages, 3 authors, 2018-02-02
STALE3051d

[PATCH 11/34] mips: fix an off-by-one in dma_capable

From: hch@lst.de (Christoph Hellwig)
Date: 2018-01-12 08:43:21
Also in: linux-alpha, linux-arch, linux-iommu, linux-mips, linux-s390, linux-sh, linuxppc-dev, lkml, sparclinux
Subsystem: mips, the rest · Maintainers: Thomas Bogendoerfer, Linus Torvalds

This makes it match the generic version.

Reported-by: Vladimir Murzin <redacted>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/mips/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index 0d9418d264f9..5c334ac15945 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -22,7 +22,7 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 	if (!dev->dma_mask)
 		return false;
 
-	return addr + size <= *dev->dma_mask;
+	return addr + size - 1 <= *dev->dma_mask;
 }
 
 static inline void dma_mark_clean(void *addr, size_t size) {}
-- 
2.14.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help