From: Christoph Hellwig Date: Wed, 10 Jan 2018 16:19:47 +0100 Subject: mips: fix an off-by-one in dma_capable Git-commit: 10dac04c79b181b255a62f60919f29acc56277ac Patch-mainline: v4.16-rc1 References: jsc#SLE-6197 FATE#327012 bsc#1140559 LTC#173150 This makes it match the generic version. Reported-by: Vladimir Murzin Signed-off-by: Christoph Hellwig Acked-by: Petr Tesarik --- arch/mips/include/asm/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h @@ -21,7 +21,7 @@ static inline bool dma_capable(struct de 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) {}