diff options
| author | Andi Kleen <ak@muc.de> | 2003-04-30 07:52:59 -0700 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2003-04-30 07:52:59 -0700 |
| commit | eb0a5728e048e61e7802a0aa3e1dcd9d0353e78f (patch) | |
| tree | 0820547da24bbe588ac95e621bf7150d592d2972 | |
| parent | d33334d346864ff2205bce81ed225ff628920f14 (diff) | |
[PATCH] discontigmem fix
Try to avoid calling "pfn_to_page()" on invalid pfn's. It used to be
legal, but the CONFIG_DISCONTIGMEM people want us to try to avoid it,
since they do magic stuff in their "pfn_to_page" translations.
| -rw-r--r-- | mm/memory.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c index a64f85fd3c33..d9b86809380f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -292,8 +292,11 @@ skip_copy_pte_range: * and not mapped via rmap - duplicate the * mapping as is. */ - page = pfn_to_page(pfn); - if (!pfn_valid(pfn) || PageReserved(page)) { + page = NULL; + if (pfn_valid(pfn)) + page = pfn_to_page(pfn); + + if (!page || PageReserved(page)) { set_pte(dst_pte, pte); goto cont_copy_pte_range_noset; } |
