From: Lennert Buytenhek Date: Thu, 8 Feb 2007 15:26:23 +0000 (+0100) Subject: [ARM] 4153/1: fix consistent_sync() off-by-one BUG check X-Git-Tag: v2.6.21-rc1~75^2~6^6~5 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3e1a80f11f89f318e892694b501735abb51ef626;p=~emulex%2Finfiniband.git [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 Signed-off-by: Russell King --- diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c index 166aee13c4b..1f9f94f9af4 100644 --- a/arch/arm/mm/consistent.c +++ b/arch/arm/mm/consistent.c @@ -485,7 +485,7 @@ void consistent_sync(const void *start, size_t size, int direction) { 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 */