]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/vmalloc: interchage the implementation of vmalloc_to_{pfn,page}
authorJianyu Zhan <nasa4836@gmail.com>
Mon, 16 Dec 2013 23:45:06 +0000 (10:45 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 16 Dec 2013 23:45:06 +0000 (10:45 +1100)
I just sent the incorrect patch...

it should be
 -   page = pte_page(pte);
 +  pfn = pte_pfn(pte);;

Cc: Vladimir Murzin <murzin.v@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmalloc.c

index a335e2107731b7b67b92a927c091607d55884b8e..e4f0db2a3eae5ea01f1a80e0d3b680a9c2fa7c08 100644 (file)
@@ -225,7 +225,7 @@ int is_vmalloc_or_module_addr(const void *x)
 unsigned long vmalloc_to_pfn(const void *vmalloc_addr)
 {
        unsigned long addr = (unsigned long) vmalloc_addr;
-       unsigned long pfn;
+       unsigned long pfn = 0;
        pgd_t *pgd = pgd_offset_k(addr);
 
        /*
@@ -244,7 +244,7 @@ unsigned long vmalloc_to_pfn(const void *vmalloc_addr)
                                ptep = pte_offset_map(pmd, addr);
                                pte = *ptep;
                                if (pte_present(pte))
-                                       pfn = pte_page(pte);
+                                       pfn = pte_pfn(pte);
                                pte_unmap(ptep);
                        }
                }