diff options
-rw-r--r-- | arch/um/kernel/process_kern.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c index 0d73ceeece72..34b54a3e2132 100644 --- a/arch/um/kernel/process_kern.c +++ b/arch/um/kernel/process_kern.c | |||
@@ -222,6 +222,7 @@ void *um_virt_to_phys(struct task_struct *task, unsigned long addr, | |||
222 | pud_t *pud; | 222 | pud_t *pud; |
223 | pmd_t *pmd; | 223 | pmd_t *pmd; |
224 | pte_t *pte; | 224 | pte_t *pte; |
225 | pte_t ptent; | ||
225 | 226 | ||
226 | if(task->mm == NULL) | 227 | if(task->mm == NULL) |
227 | return(ERR_PTR(-EINVAL)); | 228 | return(ERR_PTR(-EINVAL)); |
@@ -238,12 +239,13 @@ void *um_virt_to_phys(struct task_struct *task, unsigned long addr, | |||
238 | return(ERR_PTR(-EINVAL)); | 239 | return(ERR_PTR(-EINVAL)); |
239 | 240 | ||
240 | pte = pte_offset_kernel(pmd, addr); | 241 | pte = pte_offset_kernel(pmd, addr); |
241 | if(!pte_present(*pte)) | 242 | ptent = *pte; |
243 | if(!pte_present(ptent)) | ||
242 | return(ERR_PTR(-EINVAL)); | 244 | return(ERR_PTR(-EINVAL)); |
243 | 245 | ||
244 | if(pte_out != NULL) | 246 | if(pte_out != NULL) |
245 | *pte_out = *pte; | 247 | *pte_out = ptent; |
246 | return((void *) (pte_val(*pte) & PAGE_MASK) + (addr & ~PAGE_MASK)); | 248 | return((void *) (pte_val(ptent) & PAGE_MASK) + (addr & ~PAGE_MASK)); |
247 | } | 249 | } |
248 | 250 | ||
249 | char *current_cmd(void) | 251 | char *current_cmd(void) |