From: Ingo Molnar Date: Thu, 28 Feb 2008 13:10:49 +0000 (+0100) Subject: x86: ioremap(), extend check to all RAM pages X-Git-Tag: v2.6.26-rc1~1154^2~503 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=bdd3cee2e4b;p=linux-2.6-omap-h63xx.git x86: ioremap(), extend check to all RAM pages Suggested by Jan Beulich. Signed-off-by: Ingo Molnar Acked-by: Jan Beulich --- diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 17f51883902..e5608d38017 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -146,8 +146,9 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size, /* * Don't allow anybody to remap normal RAM that we're using.. */ - for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped && - (pfn << PAGE_SHIFT) < last_addr; pfn++) { + for (pfn = phys_addr >> PAGE_SHIFT; + (pfn << PAGE_SHIFT) < last_addr; pfn++) { + if (page_is_ram(pfn) && pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn))) return NULL;