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>
This commit is contained in:
committed by
Linus Torvalds
parent
112654208b
commit
8a93258ce3
@@ -248,7 +248,7 @@ static unsigned long get_unmapped_area_mem(struct file *file,
|
|||||||
{
|
{
|
||||||
if (!valid_mmap_phys_addr_range(pgoff, len))
|
if (!valid_mmap_phys_addr_range(pgoff, len))
|
||||||
return (unsigned long) -EINVAL;
|
return (unsigned long) -EINVAL;
|
||||||
return pgoff;
|
return pgoff << PAGE_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* can't do an in-place private mapping if there's no MMU */
|
/* can't do an in-place private mapping if there's no MMU */
|
||||||
|
Reference in New Issue
Block a user