Skip to content

Commit

Permalink
x86: ioremap(), extend check to all RAM pages
Browse files Browse the repository at this point in the history
Suggested by Jan Beulich.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jan Beulich <jbeulich@novell.com>
  • Loading branch information
Ingo Molnar committed Apr 17, 2008
1 parent b089c12 commit bdd3cee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/x86/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bdd3cee

Please sign in to comment.