[PATCH 11/34] mips: fix an off-by-one in dma_capable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
- Subject: [PATCH 11/34] mips: fix an off-by-one in dma_capable
- From: Christoph Hellwig <hch@xxxxxx>
- Date: Fri, 12 Jan 2018 09:42:09 +0100
- Cc: Konrad Rzeszutek Wilk <konrad@xxxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-c6x-dev@xxxxxxxxxxxxx, linux-cris-kernel@xxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-metag@xxxxxxxxxxxxxxx, Michal Simek <monstr@xxxxxxxxx>, linux-mips@xxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, patches@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, Guan Xuetao <gxt@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- In-reply-to: <20180112084232.2857-1-hch@lst.de>
- References: <20180112084232.2857-1-hch@lst.de>
This makes it match the generic version.
Reported-by: Vladimir Murzin <vladimir.murzin@xxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]