diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-04-17 01:53:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-17 19:36:27 -0400 |
commit | 8a93258ce302c2b597289770cb7de8dba7c6c219 (patch) | |
tree | 6a1ce03d17f7ffdeef57e9ff07804a9fff089fc8 /drivers/char/mem.c | |
parent | 112654208bd6f092e064973b8fa680e37ffa74a6 (diff) |
fix bogon in /dev/mem mmap'ing on nommu
While digging through my MAP_FIXED changes, I found that rather obvious
bug in /dev/mem mmap implementation for nommu archs. get_unmapped_area()
is expected to return an address, not a pfn.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-By: David Howells <dhowells@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r-- | drivers/char/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index f5c160caf9f4..5f066963f171 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -248,7 +248,7 @@ static unsigned long get_unmapped_area_mem(struct file *file, | |||
248 | { | 248 | { |
249 | if (!valid_mmap_phys_addr_range(pgoff, len)) | 249 | if (!valid_mmap_phys_addr_range(pgoff, len)) |
250 | return (unsigned long) -EINVAL; | 250 | return (unsigned long) -EINVAL; |
251 | return pgoff; | 251 | return pgoff << PAGE_SHIFT; |
252 | } | 252 | } |
253 | 253 | ||
254 | /* can't do an in-place private mapping if there's no MMU */ | 254 | /* can't do an in-place private mapping if there's no MMU */ |