aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/mm/fault_32.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c
index 0c776fdfbdda..e8efda9846bb 100644
--- a/arch/sh/mm/fault_32.c
+++ b/arch/sh/mm/fault_32.c
@@ -61,7 +61,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
61 pgd = get_TTB() + offset; 61 pgd = get_TTB() + offset;
62 pgd_k = swapper_pg_dir + offset; 62 pgd_k = swapper_pg_dir + offset;
63 63
64 /* This will never happen with the folded page table. */
65 if (!pgd_present(*pgd)) { 64 if (!pgd_present(*pgd)) {
66 if (!pgd_present(*pgd_k)) 65 if (!pgd_present(*pgd_k))
67 goto bad_area_nosemaphore; 66 goto bad_area_nosemaphore;
@@ -71,9 +70,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
71 70
72 pud = pud_offset(pgd, address); 71 pud = pud_offset(pgd, address);
73 pud_k = pud_offset(pgd_k, address); 72 pud_k = pud_offset(pgd_k, address);
74 if (pud_present(*pud) || !pud_present(*pud_k)) 73
75 goto bad_area_nosemaphore; 74 if (!pud_present(*pud)) {
76 set_pud(pud, *pud_k); 75 if (!pud_present(*pud_k))
76 goto bad_area_nosemaphore;
77 set_pud(pud, *pud_k);
78 return;
79 }
77 80
78 pmd = pmd_offset(pud, address); 81 pmd = pmd_offset(pud, address);
79 pmd_k = pmd_offset(pud_k, address); 82 pmd_k = pmd_offset(pud_k, address);