Home Home > GIT Browse
diff options
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-04-16 22:53:16 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-01 17:06:00 -0700
commitb438299c93753620877d3a848c0f82757d211b31 (patch)
parent86f757f0125d688bdd3d211df3859e013d8544b2 (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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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,
if (!valid_mmap_phys_addr_range(pgoff, len))
return (unsigned long) -EINVAL;
- return pgoff;
+ return pgoff << PAGE_SHIFT;
/* can't do an in-place private mapping if there's no MMU */