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.
* 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;
}