[ARM] 4153/1: fix consistent_sync() off-by-one BUG check
In consistent_sync(), start + size can end up pointing one byte
beyond the end of the direct RAM mapping. We shouldn't BUG() when
this happens.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index 166aee1..1f9f94f 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -485,7 +485,7 @@
{
const void *end = start + size;
- BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end));
+ BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end - 1));
switch (direction) {
case DMA_FROM_DEVICE: /* invalidate only */