]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ARM: 5740/1: fix valid_phys_addr_range() range check
authorGreg Ungerer <gerg@snapgear.com>
Thu, 1 Oct 2009 23:45:28 +0000 (00:45 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 2 Oct 2009 21:32:34 +0000 (22:32 +0100)
Commit 1522ac3ec95ff0230e7aa516f86b674fdf72866c
("Fix virtual to physical translation macro corner cases")
breaks the end of memory check in valid_phys_addr_range().
The modified expression results in the apparent /dev/mem size
being 2 bytes smaller than what it actually is.

This patch reworks the expression to correctly check the address,
while maintaining use of a valid address to __pa().

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/mmap.c

index f7457fea6de8e84c5aefe949412845550b1bfa5e..2b7996401b0f9f602dfa2d809f86e40b57f79117 100644 (file)
@@ -124,7 +124,7 @@ int valid_phys_addr_range(unsigned long addr, size_t size)
 {
        if (addr < PHYS_OFFSET)
                return 0;
-       if (addr + size >= __pa(high_memory - 1))
+       if (addr + size > __pa(high_memory - 1) + 1)
                return 0;
 
        return 1;