Skip to content

Commit

Permalink
[ARM] 4153/1: fix consistent_sync() off-by-one BUG check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lennert Buytenhek authored and Russell King committed Feb 8, 2007
1 parent 7ae5a76 commit 3e1a80f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mm/consistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3e1a80f

Please sign in to comment.