Skip to content

Commit

Permalink
mips: fix an off-by-one in dma_capable
Browse files Browse the repository at this point in the history
This makes it match the generic version.

Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Christoph Hellwig committed Jan 10, 2018
1 parent 298f002 commit 10dac04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit 10dac04

Please sign in to comment.