]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mips: fix an off-by-one in dma_capable
authorChristoph Hellwig <hch@lst.de>
Wed, 10 Jan 2018 15:19:47 +0000 (16:19 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 10 Jan 2018 15:25:24 +0000 (16:25 +0100)
This makes it match the generic version.

Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
arch/mips/include/asm/dma-mapping.h

index 0d9418d264f94fe69bb8750c47ba00fe36f1d9bd..5c334ac159457777b31a747f9aa169aded8e799f 100644 (file)
@@ -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) {}