[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1176342114.8061.116.camel@localhost.localdomain>
Date: Thu, 12 Apr 2007 11:41:54 +1000
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Andrew Morton <akpm@...l.org>
Cc: David Howells <dhowells@...hat.com>,
Linux Kernel list <linux-kernel@...r.kernel.org>,
Greg KH <greg@...ah.com>
Subject: [PATCH] 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@...nel.crashing.org>
---
I suppose that can go in anytime, and probably in stable too, Dave ?
Index: linux-cell/drivers/char/mem.c
===================================================================
--- linux-cell.orig/drivers/char/mem.c 2007-02-12 10:36:14.000000000 +1100
+++ linux-cell/drivers/char/mem.c 2007-04-12 11:38:44.000000000 +1000
@@ -248,7 +248,7 @@ static unsigned long get_unmapped_area_m
{
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 */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists