diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2007-02-08 10:26:23 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-08 10:29:00 -0500 |
commit | 3e1a80f11f89f318e892694b501735abb51ef626 (patch) | |
tree | 668ae6bb4240371f4fd772b2bc5faaf6ada9166e /arch/arm/mm/consistent.c | |
parent | 7ae5a761d2ffc4cf7d3248e09f4d3da234434f30 (diff) |
[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>
Diffstat (limited to 'arch/arm/mm/consistent.c')
-rw-r--r-- | arch/arm/mm/consistent.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c index 166aee13c4b1..1f9f94f9af4b 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) | |||
485 | { | 485 | { |
486 | const void *end = start + size; | 486 | const void *end = start + size; |
487 | 487 | ||
488 | BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end)); | 488 | BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end - 1)); |
489 | 489 | ||
490 | switch (direction) { | 490 | switch (direction) { |
491 | case DMA_FROM_DEVICE: /* invalidate only */ | 491 | case DMA_FROM_DEVICE: /* invalidate only */ |