diff options
author | Greg Ungerer <gerg@snapgear.com> | 2009-10-01 19:45:28 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-02 17:32:34 -0400 |
commit | 6806bfe18fca92e2001538b84cab5f63c5ea4bed (patch) | |
tree | 5279f344e2da4fd87dadd5a2e39142175807f1e7 /arch/arm/mm | |
parent | 31abdb744179159f8b605f56da5b197b188e1689 (diff) |
ARM: 5740/1: fix valid_phys_addr_range() range check
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>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/mmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index f7457fea6de8..2b7996401b0f 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -124,7 +124,7 @@ int valid_phys_addr_range(unsigned long addr, size_t size) | |||
124 | { | 124 | { |
125 | if (addr < PHYS_OFFSET) | 125 | if (addr < PHYS_OFFSET) |
126 | return 0; | 126 | return 0; |
127 | if (addr + size >= __pa(high_memory - 1)) | 127 | if (addr + size > __pa(high_memory - 1) + 1) |
128 | return 0; | 128 | return 0; |
129 | 129 | ||
130 | return 1; | 130 | return 1; |