diff options
-rw-r--r-- | arch/x86/mm/pageattr_64.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c index 73dbbb4048e6..7b734ee5b7fd 100644 --- a/arch/x86/mm/pageattr_64.c +++ b/arch/x86/mm/pageattr_64.c | |||
@@ -19,26 +19,21 @@ pte_t *lookup_address(unsigned long address, int *level) | |||
19 | pgd_t *pgd = pgd_offset_k(address); | 19 | pgd_t *pgd = pgd_offset_k(address); |
20 | pud_t *pud; | 20 | pud_t *pud; |
21 | pmd_t *pmd; | 21 | pmd_t *pmd; |
22 | pte_t *pte; | ||
23 | 22 | ||
24 | if (pgd_none(*pgd)) | 23 | if (pgd_none(*pgd)) |
25 | return NULL; | 24 | return NULL; |
26 | pud = pud_offset(pgd, address); | 25 | pud = pud_offset(pgd, address); |
27 | if (!pud_present(*pud)) | 26 | if (pud_none(*pud)) |
28 | return NULL; | 27 | return NULL; |
29 | pmd = pmd_offset(pud, address); | 28 | pmd = pmd_offset(pud, address); |
30 | if (!pmd_present(*pmd)) | 29 | if (pmd_none(*pmd)) |
31 | return NULL; | 30 | return NULL; |
32 | *level = 3; | 31 | *level = 3; |
33 | if (pmd_large(*pmd)) | 32 | if (pmd_large(*pmd)) |
34 | return (pte_t *)pmd; | 33 | return (pte_t *)pmd; |
35 | *level = 4; | 34 | *level = 4; |
36 | 35 | ||
37 | pte = pte_offset_kernel(pmd, address); | 36 | return pte_offset_kernel(pmd, address); |
38 | if (pte && !pte_present(*pte)) | ||
39 | pte = NULL; | ||
40 | |||
41 | return pte; | ||
42 | } | 37 | } |
43 | 38 | ||
44 | static struct page * | 39 | static struct page * |