]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] discontigmem fix
authorAndi Kleen <ak@muc.de>
Wed, 30 Apr 2003 14:52:59 +0000 (07:52 -0700)
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>
Wed, 30 Apr 2003 14:52:59 +0000 (07:52 -0700)
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.

mm/memory.c

index a64f85fd3c337af25868dc534c4d237f5aee2a2c..d9b86809380f2376b975991db597a758008bc406 100644 (file)
@@ -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;
                                }